[Scipy-svn] r6454 - branches/0.8.x/scipy/special

scipy-svn at scipy.org scipy-svn at scipy.org
Mon May 31 04:46:01 EDT 2010


Author: ptvirtan
Date: 2010-05-31 03:46:01 -0500 (Mon, 31 May 2010)
New Revision: 6454

Modified:
   branches/0.8.x/scipy/special/lambertw.c
   branches/0.8.x/scipy/special/orthogonal_eval.c
Log:
special: regenerate lambertw.c and orthogonal_eval.c from Cython sources

(cherry picked from commit r6451)

Modified: branches/0.8.x/scipy/special/lambertw.c
===================================================================
--- branches/0.8.x/scipy/special/lambertw.c	2010-05-31 08:45:53 UTC (rev 6453)
+++ branches/0.8.x/scipy/special/lambertw.c	2010-05-31 08:46:01 UTC (rev 6454)
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.12 on Thu Dec 31 12:01:02 2009 */
+/* Generated by Cython 0.12.1 on Mon May 31 10:16:35 2010 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
@@ -6,6 +6,7 @@
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
 #else
+
 #ifndef PY_LONG_LONG
   #define PY_LONG_LONG LONG_LONG
 #endif
@@ -17,6 +18,7 @@
   #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
   #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   typedef int Py_ssize_t;
   #define PY_SSIZE_T_MAX INT_MAX
@@ -26,7 +28,9 @@
   #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
   #define PyNumber_Index(o)    PyNumber_Int(o)
   #define PyIndex_Check(o)     PyNumber_Check(o)
+  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
 #endif
+
 #if PY_VERSION_HEX < 0x02060000
   #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
   #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
@@ -36,17 +40,17 @@
   #define PyType_Modified(t)
 
   typedef struct {
-       void *buf;
-       PyObject *obj;
-       Py_ssize_t len;
-       Py_ssize_t itemsize;
-       int readonly;
-       int ndim;
-       char *format;
-       Py_ssize_t *shape;
-       Py_ssize_t *strides;
-       Py_ssize_t *suboffsets;
-       void *internal;
+     void *buf;
+     PyObject *obj;
+     Py_ssize_t len;
+     Py_ssize_t itemsize;
+     int readonly;
+     int ndim;
+     char *format;
+     Py_ssize_t *shape;
+     Py_ssize_t *strides;
+     Py_ssize_t *suboffsets;
+     void *internal;
   } Py_buffer;
 
   #define PyBUF_SIMPLE 0
@@ -60,18 +64,22 @@
   #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
 
 #endif
+
 #if PY_MAJOR_VERSION < 3
   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
 #else
   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
 #endif
+
 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
   #define PyString_Type                PyUnicode_Type
@@ -80,6 +88,7 @@
   #define PyBytes_Type                 PyString_Type
   #define PyBytes_CheckExact           PyString_CheckExact
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define PyInt_Type                   PyLong_Type
   #define PyInt_Check(op)              PyLong_Check(op)
@@ -99,10 +108,13 @@
 #else
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
 #endif
+
 #if !defined(WIN32) && !defined(MS_WINDOWS)
   #ifndef __stdcall
     #define __stdcall
@@ -116,6 +128,7 @@
 #else
   #define _USE_MATH_DEFINES
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
@@ -125,6 +138,7 @@
   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   #define __Pyx_NAMESTR(n) ((char *)(n))
   #define __Pyx_DOCSTR(n)  ((char *)(n))
@@ -144,12 +158,14 @@
 #include "numpy/arrayobject.h"
 #include "numpy/ufuncobject.h"
 
-#ifdef __GNUC__
-#define INLINE __inline__
-#elif _WIN32
-#define INLINE __inline
-#else
-#define INLINE 
+#ifndef CYTHON_INLINE
+  #if defined(__GNUC__)
+    #define CYTHON_INLINE __inline__
+  #elif defined(_MSC_VER)
+    #define CYTHON_INLINE __inline
+  #else
+    #define CYTHON_INLINE 
+  #endif
 #endif
 
 typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
@@ -171,8 +187,8 @@
 #define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))
 
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 
 #if !defined(T_PYSSIZET)
 #if PY_VERSION_HEX < 0x02050000
@@ -236,9 +252,9 @@
 #endif
 #endif
 
-static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
-static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 
@@ -286,6 +302,11 @@
   #endif
 #endif
 
+#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
+  #undef _Complex_I
+  #define _Complex_I 1.0fj
+#endif
+
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
     typedef ::std::complex< double > __pyx_t_double_complex;
@@ -373,15 +394,7 @@
     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
 #endif
 
-#if CYTHON_CCOMPLEX
-  #ifdef __cplusplus
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
-  #else
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
-  #endif
-#else
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
-#endif
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
 
 #if CYTHON_CCOMPLEX
     #define __Pyx_c_eq(a, b)   ((a)==(b))
@@ -400,15 +413,15 @@
     /*#define __Pyx_c_abs(z)     (cabs(z))*/
  #endif
 #else
-    static INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
-    static INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
-    static INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
-    static INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
-    static INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
-    static INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
-    static INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
-    static INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
-    /*static INLINE double __Pyx_c_abs(__pyx_t_double_complex);*/
+    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
+    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
+    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
+    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
+    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
+    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
+    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
+    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
+    /*static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);*/
 #endif
 
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
@@ -419,57 +432,68 @@
         PyComplex_FromDoubles((double)__Pyx_CREAL(z), \
                               (double)__Pyx_CIMAG(z))
 
-static INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp);
+static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp);
 
-static INLINE npy_intp __Pyx_PyInt_from_py_npy_intp(PyObject *);
+static CYTHON_INLINE npy_intp __Pyx_PyInt_from_py_npy_intp(PyObject *);
 
-static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
+static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
 
-static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
+static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
 
-static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
+static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
 
-static INLINE char __Pyx_PyInt_AsChar(PyObject *);
+static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
 
-static INLINE short __Pyx_PyInt_AsShort(PyObject *);
+static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
 
-static INLINE int __Pyx_PyInt_AsInt(PyObject *);
+static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
 
-static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
+static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
 
-static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
 
-static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
+static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
 
-static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
+static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
 
-static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
+static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
 
-static INLINE long __Pyx_PyInt_AsLong(PyObject *);
+static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
 
-static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
+static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
 
-static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
 
-static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
 
-static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+#ifndef __PYX_FORCE_INIT_THREADS
+  #if PY_VERSION_HEX < 0x02040200
+    #define __PYX_FORCE_INIT_THREADS 1
+  #else
+    #define __PYX_FORCE_INIT_THREADS 0
+  #endif
+#endif
 
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+
 static void __Pyx_WriteUnraisable(const char *name); /*proto*/
 
 static void __Pyx_AddTraceback(const char *funcname); /*proto*/
 
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+/* Module declarations from cython */
+
 /* Module declarations from scipy.special.lambertw */
 
 static PyUFuncGenericFunction __pyx_v_5scipy_7special_8lambertw__loop_funcs[1];
 static char __pyx_v_5scipy_7special_8lambertw__inp_outp_types[4];
 static void *__pyx_v_5scipy_7special_8lambertw_the_func_to_apply[1];
-static INLINE int __pyx_f_5scipy_7special_8lambertw_zisnan(__pyx_t_double_complex); /*proto*/
-static INLINE double __pyx_f_5scipy_7special_8lambertw_zabs(__pyx_t_double_complex); /*proto*/
-static INLINE __pyx_t_double_complex __pyx_f_5scipy_7special_8lambertw_zlog(__pyx_t_double_complex); /*proto*/
-static INLINE __pyx_t_double_complex __pyx_f_5scipy_7special_8lambertw_zexp(__pyx_t_double_complex); /*proto*/
+static CYTHON_INLINE int __pyx_f_5scipy_7special_8lambertw_zisnan(__pyx_t_double_complex); /*proto*/
+static CYTHON_INLINE double __pyx_f_5scipy_7special_8lambertw_zabs(__pyx_t_double_complex); /*proto*/
+static CYTHON_INLINE __pyx_t_double_complex __pyx_f_5scipy_7special_8lambertw_zlog(__pyx_t_double_complex); /*proto*/
+static CYTHON_INLINE __pyx_t_double_complex __pyx_f_5scipy_7special_8lambertw_zexp(__pyx_t_double_complex); /*proto*/
+static void __pyx_f_5scipy_7special_8lambertw_lambertw_raise_warning(__pyx_t_double_complex); /*proto*/
 static __pyx_t_double_complex __pyx_f_5scipy_7special_8lambertw_lambertw_scalar(__pyx_t_double_complex, long, double); /*proto*/
 static void __pyx_f_5scipy_7special_8lambertw__apply_func_to_1d_vec(char **, npy_intp *, npy_intp *, void *); /*proto*/
 #define __Pyx_MODULE_NAME "scipy.special.lambertw"
@@ -479,7 +503,7 @@
 static PyObject *__pyx_builtin_range;
 static char __pyx_k_1[] = "Lambert W iteration failed to converge: %r";
 static char __pyx_k_3[] = "";
-static char __pyx_k_4[] = "lambertw (line 194)";
+static char __pyx_k_4[] = "lambertw (line 193)";
 static char __pyx_k__k[] = "k";
 static char __pyx_k__z[] = "z";
 static char __pyx_k__tol[] = "tol";
@@ -509,27 +533,26 @@
 static PyObject *__pyx_int_0;
 static PyObject *__pyx_k_2;
 
-/* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":47
- *     enum NPY_DISABLE_C_API: NPY_DISABLE_C_API
+/* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":44
+ *     double NPY_PI
  * 
- * cdef inline bint zisnan(double complex x):             # <<<<<<<<<<<<<<
+ * cdef inline bint zisnan(double complex x) nogil:             # <<<<<<<<<<<<<<
  *     return npy_isnan(x.real) or npy_isnan(x.imag)
  * 
  */
 
-static INLINE int __pyx_f_5scipy_7special_8lambertw_zisnan(__pyx_t_double_complex __pyx_v_x) {
+static CYTHON_INLINE int __pyx_f_5scipy_7special_8lambertw_zisnan(__pyx_t_double_complex __pyx_v_x) {
   int __pyx_r;
   int __pyx_t_1;
   int __pyx_t_2;
   int __pyx_t_3;
-  __Pyx_RefNannySetupContext("zisnan");
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":48
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":45
  * 
- * cdef inline bint zisnan(double complex x):
+ * cdef inline bint zisnan(double complex x) nogil:
  *     return npy_isnan(x.real) or npy_isnan(x.imag)             # <<<<<<<<<<<<<<
  * 
- * cdef inline double zabs(double complex x):
+ * cdef inline double zabs(double complex x) nogil:
  */
   __pyx_t_1 = npy_isnan(__Pyx_CREAL(__pyx_v_x));
   if (!__pyx_t_1) {
@@ -543,25 +566,23 @@
 
   __pyx_r = 0;
   __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":50
+/* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":47
  *     return npy_isnan(x.real) or npy_isnan(x.imag)
  * 
- * cdef inline double zabs(double complex x):             # <<<<<<<<<<<<<<
+ * cdef inline double zabs(double complex x) nogil:             # <<<<<<<<<<<<<<
  *     cdef double r
  *     r = npy_cabs((<npy_cdouble*>&x)[0])
  */
 
-static INLINE double __pyx_f_5scipy_7special_8lambertw_zabs(__pyx_t_double_complex __pyx_v_x) {
+static CYTHON_INLINE double __pyx_f_5scipy_7special_8lambertw_zabs(__pyx_t_double_complex __pyx_v_x) {
   double __pyx_v_r;
   double __pyx_r;
-  __Pyx_RefNannySetupContext("zabs");
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":52
- * cdef inline double zabs(double complex x):
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":49
+ * cdef inline double zabs(double complex x) nogil:
  *     cdef double r
  *     r = npy_cabs((<npy_cdouble*>&x)[0])             # <<<<<<<<<<<<<<
  *     return r
@@ -569,37 +590,35 @@
  */
   __pyx_v_r = npy_cabs((((npy_cdouble *)(&__pyx_v_x))[0]));
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":53
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":50
  *     cdef double r
  *     r = npy_cabs((<npy_cdouble*>&x)[0])
  *     return r             # <<<<<<<<<<<<<<
  * 
- * cdef inline double complex zlog(double complex x):
+ * cdef inline double complex zlog(double complex x) nogil:
  */
   __pyx_r = __pyx_v_r;
   goto __pyx_L0;
 
   __pyx_r = 0;
   __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":55
+/* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":52
  *     return r
  * 
- * cdef inline double complex zlog(double complex x):             # <<<<<<<<<<<<<<
+ * cdef inline double complex zlog(double complex x) nogil:             # <<<<<<<<<<<<<<
  *     cdef npy_cdouble r
  *     r = npy_clog((<npy_cdouble*>&x)[0])
  */
 
-static INLINE __pyx_t_double_complex __pyx_f_5scipy_7special_8lambertw_zlog(__pyx_t_double_complex __pyx_v_x) {
+static CYTHON_INLINE __pyx_t_double_complex __pyx_f_5scipy_7special_8lambertw_zlog(__pyx_t_double_complex __pyx_v_x) {
   npy_cdouble __pyx_v_r;
   __pyx_t_double_complex __pyx_r;
-  __Pyx_RefNannySetupContext("zlog");
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":57
- * cdef inline double complex zlog(double complex x):
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":54
+ * cdef inline double complex zlog(double complex x) nogil:
  *     cdef npy_cdouble r
  *     r = npy_clog((<npy_cdouble*>&x)[0])             # <<<<<<<<<<<<<<
  *     return (<double complex*>&r)[0]
@@ -607,37 +626,35 @@
  */
   __pyx_v_r = npy_clog((((npy_cdouble *)(&__pyx_v_x))[0]));
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":58
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":55
  *     cdef npy_cdouble r
  *     r = npy_clog((<npy_cdouble*>&x)[0])
  *     return (<double complex*>&r)[0]             # <<<<<<<<<<<<<<
  * 
- * cdef inline double complex zexp(double complex x):
+ * cdef inline double complex zexp(double complex x) nogil:
  */
   __pyx_r = (((__pyx_t_double_complex *)(&__pyx_v_r))[0]);
   goto __pyx_L0;
 
   __pyx_r = __pyx_t_double_complex_from_parts(0, 0);
   __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":60
+/* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":57
  *     return (<double complex*>&r)[0]
  * 
- * cdef inline double complex zexp(double complex x):             # <<<<<<<<<<<<<<
+ * cdef inline double complex zexp(double complex x) nogil:             # <<<<<<<<<<<<<<
  *     cdef npy_cdouble r
  *     r = npy_cexp((<npy_cdouble*>&x)[0])
  */
 
-static INLINE __pyx_t_double_complex __pyx_f_5scipy_7special_8lambertw_zexp(__pyx_t_double_complex __pyx_v_x) {
+static CYTHON_INLINE __pyx_t_double_complex __pyx_f_5scipy_7special_8lambertw_zexp(__pyx_t_double_complex __pyx_v_x) {
   npy_cdouble __pyx_v_r;
   __pyx_t_double_complex __pyx_r;
-  __Pyx_RefNannySetupContext("zexp");
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":62
- * cdef inline double complex zexp(double complex x):
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":59
+ * cdef inline double complex zexp(double complex x) nogil:
  *     cdef npy_cdouble r
  *     r = npy_cexp((<npy_cdouble*>&x)[0])             # <<<<<<<<<<<<<<
  *     return (<double complex*>&r)[0]
@@ -645,26 +662,79 @@
  */
   __pyx_v_r = npy_cexp((((npy_cdouble *)(&__pyx_v_x))[0]));
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":63
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":60
  *     cdef npy_cdouble r
  *     r = npy_cexp((<npy_cdouble*>&x)[0])
  *     return (<double complex*>&r)[0]             # <<<<<<<<<<<<<<
  * 
- * # Heavy lifting is here:
+ * cdef void lambertw_raise_warning(double complex z) with gil:
  */
   __pyx_r = (((__pyx_t_double_complex *)(&__pyx_v_r))[0]);
   goto __pyx_L0;
 
   __pyx_r = __pyx_t_double_complex_from_parts(0, 0);
   __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":67
+/* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":62
+ *     return (<double complex*>&r)[0]
+ * 
+ * cdef void lambertw_raise_warning(double complex z) with gil:             # <<<<<<<<<<<<<<
+ *     warnings.warn("Lambert W iteration failed to converge: %r" % z)
+ * 
+ */
+
+static  void __pyx_f_5scipy_7special_8lambertw_lambertw_raise_warning(__pyx_t_double_complex __pyx_v_z) {
+  PyObject *__pyx_t_1 = NULL;
+  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  PyGILState_STATE _save = PyGILState_Ensure();
+  __Pyx_RefNannySetupContext("lambertw_raise_warning");
+
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":63
+ * 
+ * cdef void lambertw_raise_warning(double complex z) with gil:
+ *     warnings.warn("Lambert W iteration failed to converge: %r" % z)             # <<<<<<<<<<<<<<
+ * 
  * # Heavy lifting is here:
+ */
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__warnings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __pyx_PyComplex_FromComplex(__pyx_v_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __pyx_t_3 = 0;
+  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_WriteUnraisable("scipy.special.lambertw.lambertw_raise_warning");
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  PyGILState_Release(_save);
+}
+
+/* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":68
  * 
- * cdef double complex lambertw_scalar(double complex z, long k, double tol):             # <<<<<<<<<<<<<<
+ * @cython.cdivision(True)
+ * cdef double complex lambertw_scalar(double complex z, long k, double tol) nogil:             # <<<<<<<<<<<<<<
  *     """
  *     This is just the implementation of W for a single input z.
  */
@@ -685,15 +755,8 @@
   int __pyx_t_4;
   long __pyx_t_5;
   int __pyx_t_6;
-  __pyx_t_double_complex __pyx_t_7;
-  __pyx_t_double_complex __pyx_t_8;
-  __pyx_t_double_complex __pyx_t_9;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  __Pyx_RefNannySetupContext("lambertw_scalar");
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":73
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":74
  *     """
  *     # Comments copied verbatim from [2] are marked with '>'
  *     if zisnan(z):             # <<<<<<<<<<<<<<
@@ -703,7 +766,7 @@
   __pyx_t_1 = __pyx_f_5scipy_7special_8lambertw_zisnan(__pyx_v_z);
   if (__pyx_t_1) {
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":74
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":75
  *     # Comments copied verbatim from [2] are marked with '>'
  *     if zisnan(z):
  *         return z             # <<<<<<<<<<<<<<
@@ -716,7 +779,7 @@
   }
   __pyx_L3:;
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":81
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":82
  *     #> We must be extremely careful near the singularities at -1/e and 0
  *     cdef double u
  *     u = exp(-1)             # <<<<<<<<<<<<<<
@@ -725,7 +788,7 @@
  */
   __pyx_v_u = exp(-1);
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":84
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":85
  * 
  *     cdef double absz
  *     absz = zabs(z)             # <<<<<<<<<<<<<<
@@ -734,7 +797,7 @@
  */
   __pyx_v_absz = __pyx_f_5scipy_7special_8lambertw_zabs(__pyx_v_z);
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":85
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":86
  *     cdef double absz
  *     absz = zabs(z)
  *     if absz <= u:             # <<<<<<<<<<<<<<
@@ -744,7 +807,7 @@
   __pyx_t_1 = (__pyx_v_absz <= __pyx_v_u);
   if (__pyx_t_1) {
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":86
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":87
  *     absz = zabs(z)
  *     if absz <= u:
  *         if z == 0:             # <<<<<<<<<<<<<<
@@ -754,7 +817,7 @@
     __pyx_t_1 = (__Pyx_c_eq(__pyx_v_z, __pyx_t_double_complex_from_parts(0, 0)));
     if (__pyx_t_1) {
 
-      /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":88
+      /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":89
  *         if z == 0:
  *             #> w(0,0) = 0; for all other branches we hit the pole
  *             if k == 0:             # <<<<<<<<<<<<<<
@@ -764,7 +827,7 @@
       __pyx_t_1 = (__pyx_v_k == 0);
       if (__pyx_t_1) {
 
-        /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":89
+        /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":90
  *             #> w(0,0) = 0; for all other branches we hit the pole
  *             if k == 0:
  *                 return z             # <<<<<<<<<<<<<<
@@ -777,7 +840,7 @@
       }
       __pyx_L6:;
 
-      /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":90
+      /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":91
  *             if k == 0:
  *                 return z
  *             return -NPY_INFINITY             # <<<<<<<<<<<<<<
@@ -790,7 +853,7 @@
     }
     __pyx_L5:;
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":92
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":93
  *             return -NPY_INFINITY
  * 
  *         if k == 0:             # <<<<<<<<<<<<<<
@@ -800,7 +863,7 @@
     __pyx_t_1 = (__pyx_v_k == 0);
     if (__pyx_t_1) {
 
-      /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":93
+      /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":94
  * 
  *         if k == 0:
  *             w = z # Initial guess for iteration             # <<<<<<<<<<<<<<
@@ -811,7 +874,7 @@
       goto __pyx_L7;
     }
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":95
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":96
  *             w = z # Initial guess for iteration
  *         #> For small real z < 0, the -1 branch beaves roughly like log(-z)
  *         elif k == -1 and z.imag ==0 and z.real < 0:             # <<<<<<<<<<<<<<
@@ -833,7 +896,7 @@
     }
     if (__pyx_t_2) {
 
-      /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":96
+      /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":97
  *         #> For small real z < 0, the -1 branch beaves roughly like log(-z)
  *         elif k == -1 and z.imag ==0 and z.real < 0:
  *             w = log(-z.real)             # <<<<<<<<<<<<<<
@@ -845,7 +908,7 @@
     }
     /*else*/ {
 
-      /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":99
+      /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":100
  *         #> Use a simple asymptotic approximation.
  *         else:
  *             w = zlog(z)             # <<<<<<<<<<<<<<
@@ -854,7 +917,7 @@
  */
       __pyx_v_w = __pyx_f_5scipy_7special_8lambertw_zlog(__pyx_v_z);
 
-      /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":103
+      /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":104
  *             #> gets better for large |k|; need to check that this always
  *             #> works for k ~= -1, 0, 1.
  *             if k: w = w + k*2*NPY_PI*1j             # <<<<<<<<<<<<<<
@@ -872,7 +935,7 @@
     goto __pyx_L4;
   }
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":105
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":106
  *             if k: w = w + k*2*NPY_PI*1j
  * 
  *     elif k == 0 and z.imag and zabs(z) <= 0.7:             # <<<<<<<<<<<<<<
@@ -893,7 +956,7 @@
   }
   if (__pyx_t_1) {
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":109
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":110
  *         #> down around z ~= -0.5 (converging to the wrong branch), so patch
  *         #> with a constant approximation (adjusted for sign)
  *         if zabs(z+0.5) < 0.1:             # <<<<<<<<<<<<<<
@@ -903,7 +966,7 @@
     __pyx_t_1 = (__pyx_f_5scipy_7special_8lambertw_zabs(__Pyx_c_sum(__pyx_v_z, __pyx_t_double_complex_from_parts(0.5, 0))) < 0.10000000000000001);
     if (__pyx_t_1) {
 
-      /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":110
+      /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":111
  *         #> with a constant approximation (adjusted for sign)
  *         if zabs(z+0.5) < 0.1:
  *             if z.imag > 0:             # <<<<<<<<<<<<<<
@@ -913,7 +976,7 @@
       __pyx_t_1 = (__Pyx_CIMAG(__pyx_v_z) > 0);
       if (__pyx_t_1) {
 
-        /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":111
+        /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":112
  *         if zabs(z+0.5) < 0.1:
  *             if z.imag > 0:
  *                 w = 0.7 + 0.7j             # <<<<<<<<<<<<<<
@@ -925,24 +988,35 @@
       }
       /*else*/ {
 
-        /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":113
+        /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":114
  *                 w = 0.7 + 0.7j
  *             else:
  *                 w = 0.7 - 0.7j             # <<<<<<<<<<<<<<
- * 
- *     else:
+ *         else:
+ *             w = z
  */
         __pyx_v_w = __Pyx_c_diff(__pyx_t_double_complex_from_parts(0.69999999999999996, 0), __pyx_t_double_complex_from_parts(0, 0.69999999999999996));
       }
       __pyx_L10:;
       goto __pyx_L9;
     }
+    /*else*/ {
+
+      /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":116
+ *                 w = 0.7 - 0.7j
+ *         else:
+ *             w = z             # <<<<<<<<<<<<<<
+ * 
+ *     else:
+ */
+      __pyx_v_w = __pyx_v_z;
+    }
     __pyx_L9:;
     goto __pyx_L4;
   }
   /*else*/ {
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":116
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":119
  * 
  *     else:
  *         if z.real == NPY_INFINITY:             # <<<<<<<<<<<<<<
@@ -952,7 +1026,7 @@
     __pyx_t_1 = (__Pyx_CREAL(__pyx_v_z) == NPY_INFINITY);
     if (__pyx_t_1) {
 
-      /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":117
+      /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":120
  *     else:
  *         if z.real == NPY_INFINITY:
  *             if k == 0:             # <<<<<<<<<<<<<<
@@ -962,7 +1036,7 @@
       __pyx_t_1 = (__pyx_v_k == 0);
       if (__pyx_t_1) {
 
-        /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":118
+        /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":121
  *         if z.real == NPY_INFINITY:
  *             if k == 0:
  *                 return z             # <<<<<<<<<<<<<<
@@ -975,7 +1049,7 @@
       }
       /*else*/ {
 
-        /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":120
+        /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":123
  *                 return z
  *             else:
  *                 return z + 2*k*NPY_PI*1j             # <<<<<<<<<<<<<<
@@ -990,7 +1064,7 @@
     }
     __pyx_L11:;
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":122
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":125
  *                 return z + 2*k*NPY_PI*1j
  * 
  *         if z.real == -NPY_INFINITY:             # <<<<<<<<<<<<<<
@@ -1000,7 +1074,7 @@
     __pyx_t_1 = (__Pyx_CREAL(__pyx_v_z) == (-NPY_INFINITY));
     if (__pyx_t_1) {
 
-      /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":123
+      /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":126
  * 
  *         if z.real == -NPY_INFINITY:
  *             return (-z) + (2*k+1)*NPY_PI*1j             # <<<<<<<<<<<<<<
@@ -1013,7 +1087,7 @@
     }
     __pyx_L13:;
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":126
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":129
  * 
  *         #> Simple asymptotic approximation as above
  *         w = zlog(z)             # <<<<<<<<<<<<<<
@@ -1022,7 +1096,7 @@
  */
     __pyx_v_w = __pyx_f_5scipy_7special_8lambertw_zlog(__pyx_v_z);
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":127
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":130
  *         #> Simple asymptotic approximation as above
  *         w = zlog(z)
  *         if k: w = w + k*2*NPY_PI*1j             # <<<<<<<<<<<<<<
@@ -1038,7 +1112,7 @@
   }
   __pyx_L4:;
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":132
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":135
  *     cdef double complex ew, wew, wewz, wn
  *     cdef int i
  *     for i in range(100):             # <<<<<<<<<<<<<<
@@ -1048,7 +1122,7 @@
   for (__pyx_t_6 = 0; __pyx_t_6 < 100; __pyx_t_6+=1) {
     __pyx_v_i = __pyx_t_6;
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":133
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":136
  *     cdef int i
  *     for i in range(100):
  *         ew = zexp(w)             # <<<<<<<<<<<<<<
@@ -1057,7 +1131,7 @@
  */
     __pyx_v_ew = __pyx_f_5scipy_7special_8lambertw_zexp(__pyx_v_w);
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":134
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":137
  *     for i in range(100):
  *         ew = zexp(w)
  *         wew = w*ew             # <<<<<<<<<<<<<<
@@ -1066,7 +1140,7 @@
  */
     __pyx_v_wew = __Pyx_c_prod(__pyx_v_w, __pyx_v_ew);
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":135
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":138
  *         ew = zexp(w)
  *         wew = w*ew
  *         wewz = wew-z             # <<<<<<<<<<<<<<
@@ -1075,27 +1149,16 @@
  */
     __pyx_v_wewz = __Pyx_c_diff(__pyx_v_wew, __pyx_v_z);
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":136
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":139
  *         wew = w*ew
  *         wewz = wew-z
  *         wn = w - wewz / (wew + ew - (w + 2)*wewz/(2*w + 2))             # <<<<<<<<<<<<<<
  *         if zabs(wn-w) < tol*zabs(wn):
  *             return wn
  */
-    __pyx_t_7 = __Pyx_c_prod(__Pyx_c_sum(__pyx_v_w, __pyx_t_double_complex_from_parts(2, 0)), __pyx_v_wewz);
-    __pyx_t_8 = __Pyx_c_sum(__Pyx_c_prod(__pyx_t_double_complex_from_parts(2, 0), __pyx_v_w), __pyx_t_double_complex_from_parts(2, 0));
-    if (unlikely(__Pyx_c_is_zero(__pyx_t_8))) {
-      PyErr_Format(PyExc_ZeroDivisionError, "float division");
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    __pyx_t_9 = __Pyx_c_diff(__Pyx_c_sum(__pyx_v_wew, __pyx_v_ew), __Pyx_c_quot(__pyx_t_7, __pyx_t_8));
-    if (unlikely(__Pyx_c_is_zero(__pyx_t_9))) {
-      PyErr_Format(PyExc_ZeroDivisionError, "float division");
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    __pyx_v_wn = __Pyx_c_diff(__pyx_v_w, __Pyx_c_quot(__pyx_v_wewz, __pyx_t_9));
+    __pyx_v_wn = __Pyx_c_diff(__pyx_v_w, __Pyx_c_quot(__pyx_v_wewz, __Pyx_c_diff(__Pyx_c_sum(__pyx_v_wew, __pyx_v_ew), __Pyx_c_quot(__Pyx_c_prod(__Pyx_c_sum(__pyx_v_w, __pyx_t_double_complex_from_parts(2, 0)), __pyx_v_wewz), __Pyx_c_sum(__Pyx_c_prod(__pyx_t_double_complex_from_parts(2, 0), __pyx_v_w), __pyx_t_double_complex_from_parts(2, 0))))));
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":137
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":140
  *         wewz = wew-z
  *         wn = w - wewz / (wew + ew - (w + 2)*wewz/(2*w + 2))
  *         if zabs(wn-w) < tol*zabs(wn):             # <<<<<<<<<<<<<<
@@ -1105,7 +1168,7 @@
     __pyx_t_1 = (__pyx_f_5scipy_7special_8lambertw_zabs(__Pyx_c_diff(__pyx_v_wn, __pyx_v_w)) < (__pyx_v_tol * __pyx_f_5scipy_7special_8lambertw_zabs(__pyx_v_wn)));
     if (__pyx_t_1) {
 
-      /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":138
+      /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":141
  *         wn = w - wewz / (wew + ew - (w + 2)*wewz/(2*w + 2))
  *         if zabs(wn-w) < tol*zabs(wn):
  *             return wn             # <<<<<<<<<<<<<<
@@ -1118,89 +1181,30 @@
     }
     /*else*/ {
 
-      /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":140
+      /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":143
  *             return wn
  *         else:
  *             w = wn             # <<<<<<<<<<<<<<
  * 
- *     if True:
+ *     lambertw_raise_warning(z)
  */
       __pyx_v_w = __pyx_v_wn;
     }
     __pyx_L17:;
   }
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":142
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":145
  *             w = wn
  * 
- *     if True:             # <<<<<<<<<<<<<<
- *         NPY_ALLOW_C_API_DEF
- *         NPY_ALLOW_C_API
- */
-  __pyx_t_1 = 1;
-  if (__pyx_t_1) {
-
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":143
- * 
- *     if True:
- *         NPY_ALLOW_C_API_DEF             # <<<<<<<<<<<<<<
- *         NPY_ALLOW_C_API
- *         warnings.warn("Lambert W iteration failed to converge: %r" % z)
- */
-    NPY_ALLOW_C_API_DEF;
-
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":144
- *     if True:
- *         NPY_ALLOW_C_API_DEF
- *         NPY_ALLOW_C_API             # <<<<<<<<<<<<<<
- *         warnings.warn("Lambert W iteration failed to converge: %r" % z)
- *         NPY_DISABLE_C_API
- */
-    NPY_ALLOW_C_API;
-
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":145
- *         NPY_ALLOW_C_API_DEF
- *         NPY_ALLOW_C_API
- *         warnings.warn("Lambert W iteration failed to converge: %r" % z)             # <<<<<<<<<<<<<<
- *         NPY_DISABLE_C_API
+ *     lambertw_raise_warning(z)             # <<<<<<<<<<<<<<
  *     return wn
- */
-    __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__warnings); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_11 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__warn); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __pyx_t_10 = __pyx_PyComplex_FromComplex(__pyx_v_z); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_10); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_12);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
-    __Pyx_GIVEREF(__pyx_t_12);
-    __pyx_t_12 = 0;
-    __pyx_t_12 = PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_12);
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":146
- *         NPY_ALLOW_C_API
- *         warnings.warn("Lambert W iteration failed to converge: %r" % z)
- *         NPY_DISABLE_C_API             # <<<<<<<<<<<<<<
- *     return wn
  * 
  */
-    NPY_DISABLE_C_API;
-    goto __pyx_L18;
-  }
-  __pyx_L18:;
+  __pyx_f_5scipy_7special_8lambertw_lambertw_raise_warning(__pyx_v_z);
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":147
- *         warnings.warn("Lambert W iteration failed to converge: %r" % z)
- *         NPY_DISABLE_C_API
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":146
+ * 
+ *     lambertw_raise_warning(z)
  *     return wn             # <<<<<<<<<<<<<<
  * 
  * 
@@ -1209,23 +1213,15 @@
   goto __pyx_L0;
 
   __pyx_r = __pyx_t_double_complex_from_parts(0, 0);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_XDECREF(__pyx_t_12);
-  __Pyx_WriteUnraisable("scipy.special.lambertw.lambertw_scalar");
-  __pyx_r = __pyx_t_double_complex_from_parts(0, 0);
   __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":167
+/* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":166
  *         int identity, char* name, char* doc, int c)
  * 
  * cdef void _apply_func_to_1d_vec(char **args, npy_intp *dimensions, npy_intp *steps,             # <<<<<<<<<<<<<<
- *                      void *func):
+ *                      void *func) nogil:
  *     cdef npy_intp i
  */
 
@@ -1237,42 +1233,41 @@
   char *__pyx_v_op;
   npy_intp __pyx_t_1;
   npy_intp __pyx_t_2;
-  __Pyx_RefNannySetupContext("_apply_func_to_1d_vec");
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":170
- *                      void *func):
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":169
+ *                      void *func) nogil:
  *     cdef npy_intp i
  *     cdef char *ip1=args[0], *ip2=args[1], *ip3=args[2], *op=args[3]             # <<<<<<<<<<<<<<
  *     for i in range(0, dimensions[0]):
- *         (<double complex*>op)[0] = (<double complex(*)(double complex, long, double)>func)(
+ *         (<double complex*>op)[0] = (<double complex(*)(double complex, long, double) nogil>func)(
  */
   __pyx_v_ip1 = (__pyx_v_args[0]);
   __pyx_v_ip2 = (__pyx_v_args[1]);
   __pyx_v_ip3 = (__pyx_v_args[2]);
   __pyx_v_op = (__pyx_v_args[3]);
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":171
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":170
  *     cdef npy_intp i
  *     cdef char *ip1=args[0], *ip2=args[1], *ip3=args[2], *op=args[3]
  *     for i in range(0, dimensions[0]):             # <<<<<<<<<<<<<<
- *         (<double complex*>op)[0] = (<double complex(*)(double complex, long, double)>func)(
+ *         (<double complex*>op)[0] = (<double complex(*)(double complex, long, double) nogil>func)(
  *             (<double complex*>ip1)[0], (<long*>ip2)[0], (<double*>ip3)[0])
  */
   __pyx_t_1 = (__pyx_v_dimensions[0]);
   for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
     __pyx_v_i = __pyx_t_2;
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":172
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":171
  *     cdef char *ip1=args[0], *ip2=args[1], *ip3=args[2], *op=args[3]
  *     for i in range(0, dimensions[0]):
- *         (<double complex*>op)[0] = (<double complex(*)(double complex, long, double)>func)(             # <<<<<<<<<<<<<<
+ *         (<double complex*>op)[0] = (<double complex(*)(double complex, long, double) nogil>func)(             # <<<<<<<<<<<<<<
  *             (<double complex*>ip1)[0], (<long*>ip2)[0], (<double*>ip3)[0])
  *         ip1 += steps[0]; ip2 += steps[1]; ip3 += steps[2]; op += steps[3]
  */
     (((__pyx_t_double_complex *)__pyx_v_op)[0]) = ((__pyx_t_double_complex (*)(__pyx_t_double_complex, long, double))__pyx_v_func)((((__pyx_t_double_complex *)__pyx_v_ip1)[0]), (((long *)__pyx_v_ip2)[0]), (((double *)__pyx_v_ip3)[0]));
 
-    /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":174
- *         (<double complex*>op)[0] = (<double complex(*)(double complex, long, double)>func)(
+    /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":173
+ *         (<double complex*>op)[0] = (<double complex(*)(double complex, long, double) nogil>func)(
  *             (<double complex*>ip1)[0], (<long*>ip2)[0], (<double*>ip3)[0])
  *         ip1 += steps[0]; ip2 += steps[1]; ip3 += steps[2]; op += steps[3]             # <<<<<<<<<<<<<<
  * 
@@ -1284,10 +1279,9 @@
     __pyx_v_op += (__pyx_v_steps[3]);
   }
 
-  __Pyx_RefNannyFinishContext();
 }
 
-/* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":194
+/* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":193
  *     _inp_outp_types, 1, 3, 1, 0, "", "", 0)
  * 
  * def lambertw(z, k=0, tol=1e-8):             # <<<<<<<<<<<<<<
@@ -1337,7 +1331,7 @@
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "lambertw") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "lambertw") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_z = values[0];
     __pyx_v_k = values[1];
@@ -1355,22 +1349,22 @@
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("lambertw", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("lambertw", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("scipy.special.lambertw.lambertw");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":341
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":340
  * 
  *     """
  *     return _lambertw(z, k, tol)             # <<<<<<<<<<<<<<
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___lambertw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___lambertw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_v_z);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_z);
@@ -1381,7 +1375,7 @@
   __Pyx_INCREF(__pyx_v_tol);
   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_tol);
   __Pyx_GIVEREF(__pyx_v_tol);
-  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -1442,7 +1436,7 @@
   {0, 0, 0, 0, 0, 0, 0}
 };
 static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -1519,19 +1513,19 @@
   /*--- Function import code ---*/
   /*--- Execution code ---*/
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":23
- * # at `-1/e` and make sure that the proper branch is chosen there
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":24
  * 
+ * import cython
  * import warnings             # <<<<<<<<<<<<<<
  * 
  * cdef extern from "math.h":
  */
-  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":177
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":176
  * 
  * cdef PyUFuncGenericFunction _loop_funcs[1]
  * _loop_funcs[0] = _apply_func_to_1d_vec             # <<<<<<<<<<<<<<
@@ -1540,7 +1534,7 @@
  */
   (__pyx_v_5scipy_7special_8lambertw__loop_funcs[0]) = __pyx_f_5scipy_7special_8lambertw__apply_func_to_1d_vec;
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":180
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":179
  * 
  * cdef char _inp_outp_types[4]
  * _inp_outp_types[0] = NPY_CDOUBLE             # <<<<<<<<<<<<<<
@@ -1549,7 +1543,7 @@
  */
   (__pyx_v_5scipy_7special_8lambertw__inp_outp_types[0]) = NPY_CDOUBLE;
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":181
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":180
  * cdef char _inp_outp_types[4]
  * _inp_outp_types[0] = NPY_CDOUBLE
  * _inp_outp_types[1] = NPY_LONG             # <<<<<<<<<<<<<<
@@ -1558,7 +1552,7 @@
  */
   (__pyx_v_5scipy_7special_8lambertw__inp_outp_types[1]) = NPY_LONG;
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":182
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":181
  * _inp_outp_types[0] = NPY_CDOUBLE
  * _inp_outp_types[1] = NPY_LONG
  * _inp_outp_types[2] = NPY_DOUBLE             # <<<<<<<<<<<<<<
@@ -1567,7 +1561,7 @@
  */
   (__pyx_v_5scipy_7special_8lambertw__inp_outp_types[2]) = NPY_DOUBLE;
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":183
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":182
  * _inp_outp_types[1] = NPY_LONG
  * _inp_outp_types[2] = NPY_DOUBLE
  * _inp_outp_types[3] = NPY_CDOUBLE             # <<<<<<<<<<<<<<
@@ -1576,7 +1570,7 @@
  */
   (__pyx_v_5scipy_7special_8lambertw__inp_outp_types[3]) = NPY_CDOUBLE;
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":185
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":184
  * _inp_outp_types[3] = NPY_CDOUBLE
  * 
  * import_array()             # <<<<<<<<<<<<<<
@@ -1585,7 +1579,7 @@
  */
   import_array();
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":186
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":185
  * 
  * import_array()
  * import_ufunc()             # <<<<<<<<<<<<<<
@@ -1594,7 +1588,7 @@
  */
   import_ufunc();
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":190
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":189
  * # The actual ufunc declaration:
  * cdef void *the_func_to_apply[1]
  * the_func_to_apply[0] = <void*>lambertw_scalar             # <<<<<<<<<<<<<<
@@ -1603,32 +1597,32 @@
  */
   (__pyx_v_5scipy_7special_8lambertw_the_func_to_apply[0]) = ((void *)__pyx_f_5scipy_7special_8lambertw_lambertw_scalar);
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":192
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":191
  * the_func_to_apply[0] = <void*>lambertw_scalar
  * _lambertw = PyUFunc_FromFuncAndData(_loop_funcs, the_func_to_apply,
  *     _inp_outp_types, 1, 3, 1, 0, "", "", 0)             # <<<<<<<<<<<<<<
  * 
  * def lambertw(z, k=0, tol=1e-8):
  */
-  __pyx_t_1 = PyUFunc_FromFuncAndData(__pyx_v_5scipy_7special_8lambertw__loop_funcs, __pyx_v_5scipy_7special_8lambertw_the_func_to_apply, __pyx_v_5scipy_7special_8lambertw__inp_outp_types, 1, 3, 1, 0, __pyx_k_3, __pyx_k_3, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyUFunc_FromFuncAndData(__pyx_v_5scipy_7special_8lambertw__loop_funcs, __pyx_v_5scipy_7special_8lambertw_the_func_to_apply, __pyx_v_5scipy_7special_8lambertw__inp_outp_types, 1, 3, 1, 0, __pyx_k_3, __pyx_k_3, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___lambertw, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___lambertw, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":194
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":193
  *     _inp_outp_types, 1, 3, 1, 0, "", "", 0)
  * 
  * def lambertw(z, k=0, tol=1e-8):             # <<<<<<<<<<<<<<
  *     r"""
  *     lambertw(z, k=0, tol=1e-8)
  */
-  __pyx_t_1 = PyFloat_FromDouble(1e-08); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyFloat_FromDouble(1e-08); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_k_2 = __pyx_t_1;
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "/home/pauli/koodi/proj/scipy/scipy/scipy/special/lambertw.pyx":1
+  /* "/home/pauli/wrk/scipy/scipy/scipy/special/lambertw.pyx":1
  * # Implementation of the Lambert W function [1]. Based on the MPMath             # <<<<<<<<<<<<<<
  * # implementation [2], and documentaion [3].
  * #
@@ -1798,70 +1792,70 @@
 
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
       return ::std::complex< double >(x, y);
     }
   #else
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
       return x + y*(__pyx_t_double_complex)_Complex_I;
     }
   #endif
 #else
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
       __pyx_t_double_complex z;
-       z.real = x;
-       z.imag = y;
-       return z;
+      z.real = x;
+      z.imag = y;
+      return z;
     }
 #endif
 
 #if CYTHON_CCOMPLEX
 #else
-    static INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        return (a.real == b.real) && (a.imag == b.imag);
     }
-    static INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
         __pyx_t_double_complex z;
         z.real = a.real + b.real;
         z.imag = a.imag + b.imag;
         return z;
     }
-    static INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
         __pyx_t_double_complex z;
         z.real = a.real - b.real;
         z.imag = a.imag - b.imag;
         return z;
     }
-    static INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
         __pyx_t_double_complex z;
         z.real = a.real * b.real - a.imag * b.imag;
         z.imag = a.real * b.imag + a.imag * b.real;
         return z;
     }
-    static INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
         __pyx_t_double_complex z;
         double denom = b.real * b.real + b.imag * b.imag;
         z.real = (a.real * b.real + a.imag * b.imag) / denom;
         z.imag = (a.imag * b.real - a.real * b.imag) / denom;
         return z;
     }
-    static INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
+    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
         __pyx_t_double_complex z;
         z.real = -a.real;
         z.imag = -a.imag;
         return z;
     }
-    static INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
+    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
        return (a.real == 0) && (a.imag == 0);
     }
-    static INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
+    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
         __pyx_t_double_complex z;
         z.real =  a.real;
         z.imag = -a.imag;
         return z;
     }
 /*
-    static INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
+    static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
 #if HAVE_HYPOT
         return hypot(z.real, z.imag);
 #else
@@ -1912,7 +1906,7 @@
     return result;
 }
 
-static INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) {
+static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) {
     const npy_intp neg_one = (npy_intp)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(npy_intp) <  sizeof(long)) {
@@ -1930,7 +1924,7 @@
     }
 }
 
-static INLINE npy_intp __Pyx_PyInt_from_py_npy_intp(PyObject* x) {
+static CYTHON_INLINE npy_intp __Pyx_PyInt_from_py_npy_intp(PyObject* x) {
     const npy_intp neg_one = (npy_intp)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(npy_intp) == sizeof(char)) {
@@ -1971,7 +1965,7 @@
     return (npy_intp)-1;
 }
 
-static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
+static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
     const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(unsigned char) < sizeof(long)) {
@@ -1990,7 +1984,7 @@
     return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
 }
 
-static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
+static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
     const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(unsigned short) < sizeof(long)) {
@@ -2009,7 +2003,7 @@
     return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
 }
 
-static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
+static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
     const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(unsigned int) < sizeof(long)) {
@@ -2028,7 +2022,7 @@
     return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
 }
 
-static INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
+static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
     const char neg_one = (char)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(char) < sizeof(long)) {
@@ -2047,7 +2041,7 @@
     return (char)__Pyx_PyInt_AsLong(x);
 }
 
-static INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
+static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
     const short neg_one = (short)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(short) < sizeof(long)) {
@@ -2066,7 +2060,7 @@
     return (short)__Pyx_PyInt_AsLong(x);
 }
 
-static INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
+static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
     const int neg_one = (int)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(int) < sizeof(long)) {
@@ -2085,7 +2079,7 @@
     return (int)__Pyx_PyInt_AsLong(x);
 }
 
-static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
+static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
     const signed char neg_one = (signed char)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(signed char) < sizeof(long)) {
@@ -2104,7 +2098,7 @@
     return (signed char)__Pyx_PyInt_AsSignedLong(x);
 }
 
-static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
+static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
     const signed short neg_one = (signed short)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(signed short) < sizeof(long)) {
@@ -2123,7 +2117,7 @@
     return (signed short)__Pyx_PyInt_AsSignedLong(x);
 }
 
-static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
+static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
     const signed int neg_one = (signed int)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(signed int) < sizeof(long)) {
@@ -2142,7 +2136,7 @@
     return (signed int)__Pyx_PyInt_AsSignedLong(x);
 }
 
-static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
+static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
     const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
@@ -2177,7 +2171,7 @@
     }
 }
 
-static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
+static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
     const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
@@ -2212,7 +2206,7 @@
     }
 }
 
-static INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
+static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
     const long neg_one = (long)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
@@ -2247,7 +2241,7 @@
     }
 }
 
-static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
+static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
     const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
@@ -2282,7 +2276,7 @@
     }
 }
 
-static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
+static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
     const signed long neg_one = (signed long)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
@@ -2317,7 +2311,7 @@
     }
 }
 
-static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
+static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
     const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
@@ -2352,7 +2346,7 @@
     }
 }
 
-static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
     PyObject *tmp_type, *tmp_value, *tmp_tb;
     PyThreadState *tstate = PyThreadState_GET();
 
@@ -2367,7 +2361,7 @@
     Py_XDECREF(tmp_tb);
 }
 
-static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
     PyThreadState *tstate = PyThreadState_GET();
     *type = tstate->curexc_type;
     *value = tstate->curexc_value;
@@ -2499,13 +2493,13 @@
 
 /* Type Conversion Functions */
 
-static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
    if (x == Py_True) return 1;
    else if ((x == Py_False) | (x == Py_None)) return 0;
    else return PyObject_IsTrue(x);
 }
 
-static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   PyNumberMethods *m;
   const char *name = NULL;
   PyObject *res = NULL;
@@ -2551,7 +2545,7 @@
   return res;
 }
 
-static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
   Py_ssize_t ival;
   PyObject* x = PyNumber_Index(b);
   if (!x) return -1;
@@ -2560,7 +2554,7 @@
   return ival;
 }
 
-static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
 #if PY_VERSION_HEX < 0x02050000
    if (ival <= LONG_MAX)
        return PyInt_FromLong((long)ival);
@@ -2574,7 +2568,7 @@
 #endif
 }
 
-static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
+static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
    unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
    if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
        return (size_t)-1;

Modified: branches/0.8.x/scipy/special/orthogonal_eval.c
===================================================================
--- branches/0.8.x/scipy/special/orthogonal_eval.c	2010-05-31 08:45:53 UTC (rev 6453)
+++ branches/0.8.x/scipy/special/orthogonal_eval.c	2010-05-31 08:46:01 UTC (rev 6454)
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.12 on Wed Mar 31 17:45:34 2010 */
+/* Generated by Cython 0.12.1 on Mon May 31 10:17:30 2010 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
@@ -6,6 +6,7 @@
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
 #else
+
 #ifndef PY_LONG_LONG
   #define PY_LONG_LONG LONG_LONG
 #endif
@@ -17,6 +18,7 @@
   #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
   #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   typedef int Py_ssize_t;
   #define PY_SSIZE_T_MAX INT_MAX
@@ -26,7 +28,9 @@
   #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
   #define PyNumber_Index(o)    PyNumber_Int(o)
   #define PyIndex_Check(o)     PyNumber_Check(o)
+  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
 #endif
+
 #if PY_VERSION_HEX < 0x02060000
   #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
   #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
@@ -36,17 +40,17 @@
   #define PyType_Modified(t)
 
   typedef struct {
-       void *buf;
-       PyObject *obj;
-       Py_ssize_t len;
-       Py_ssize_t itemsize;
-       int readonly;
-       int ndim;
-       char *format;
-       Py_ssize_t *shape;
-       Py_ssize_t *strides;
-       Py_ssize_t *suboffsets;
-       void *internal;
+     void *buf;
+     PyObject *obj;
+     Py_ssize_t len;
+     Py_ssize_t itemsize;
+     int readonly;
+     int ndim;
+     char *format;
+     Py_ssize_t *shape;
+     Py_ssize_t *strides;
+     Py_ssize_t *suboffsets;
+     void *internal;
   } Py_buffer;
 
   #define PyBUF_SIMPLE 0
@@ -60,18 +64,22 @@
   #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
 
 #endif
+
 #if PY_MAJOR_VERSION < 3
   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
 #else
   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
 #endif
+
 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
   #define PyString_Type                PyUnicode_Type
@@ -80,6 +88,7 @@
   #define PyBytes_Type                 PyString_Type
   #define PyBytes_CheckExact           PyString_CheckExact
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define PyInt_Type                   PyLong_Type
   #define PyInt_Check(op)              PyLong_Check(op)
@@ -99,10 +108,13 @@
 #else
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
 #endif
+
 #if !defined(WIN32) && !defined(MS_WINDOWS)
   #ifndef __stdcall
     #define __stdcall
@@ -116,6 +128,7 @@
 #else
   #define _USE_MATH_DEFINES
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
@@ -125,6 +138,7 @@
   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   #define __Pyx_NAMESTR(n) ((char *)(n))
   #define __Pyx_DOCSTR(n)  ((char *)(n))
@@ -143,12 +157,14 @@
 #include "numpy/arrayobject.h"
 #include "numpy/ufuncobject.h"
 
-#ifdef __GNUC__
-#define INLINE __inline__
-#elif _WIN32
-#define INLINE __inline
-#else
-#define INLINE 
+#ifndef CYTHON_INLINE
+  #if defined(__GNUC__)
+    #define CYTHON_INLINE __inline__
+  #elif defined(_MSC_VER)
+    #define CYTHON_INLINE __inline
+  #else
+    #define CYTHON_INLINE 
+  #endif
 #endif
 
 typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
@@ -170,8 +186,8 @@
 #define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))
 
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 
 #if !defined(T_PYSSIZET)
 #if PY_VERSION_HEX < 0x02050000
@@ -235,9 +251,9 @@
 #endif
 #endif
 
-static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
-static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 
@@ -323,9 +339,9 @@
 
 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
 
-static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
 
-static INLINE void __Pyx_RaiseTooManyValuesError(void);
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void);
 
 static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
 static int __Pyx_EndUnpack(PyObject *); /*proto*/
@@ -334,42 +350,42 @@
 
 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
-static INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp);
+static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp);
 
-static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
 
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 
-static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
+static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
 
-static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
+static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
 
-static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
+static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
 
-static INLINE char __Pyx_PyInt_AsChar(PyObject *);
+static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
 
-static INLINE short __Pyx_PyInt_AsShort(PyObject *);
+static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
 
-static INLINE int __Pyx_PyInt_AsInt(PyObject *);
+static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
 
-static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
+static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
 
-static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
 
-static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
+static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
 
-static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
+static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
 
-static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
+static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
 
-static INLINE long __Pyx_PyInt_AsLong(PyObject *);
+static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
 
-static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
+static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
 
-static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
 
-static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
 
 static void __Pyx_AddTraceback(const char *funcname); /*proto*/
 
@@ -511,9 +527,9 @@
 static PyObject *__pyx_int_neg_1;
 
 /* "/home/pauli/wrk/scipy/scipy/scipy/special/orthogonal_eval.pyx":24
- *     double sqrt(double x)
+ *     double sqrt(double x) nogil
  * 
- * cdef double eval_poly_chebyt(long k, double x):             # <<<<<<<<<<<<<<
+ * cdef double eval_poly_chebyt(long k, double x) nogil:             # <<<<<<<<<<<<<<
  *     # Use Chebyshev T recurrence directly, see [MH]
  *     cdef long m
  */
@@ -525,7 +541,7 @@
   double __pyx_v_b0;
   double __pyx_r;
   long __pyx_t_1;
-  __Pyx_RefNannySetupContext("eval_poly_chebyt");
+  long __pyx_t_2;
 
   /* "/home/pauli/wrk/scipy/scipy/scipy/special/orthogonal_eval.pyx":29
  *     cdef double b2, b1, b0
@@ -550,7 +566,7 @@
  *     b1 = -1
  *     b0 = 0             # <<<<<<<<<<<<<<
  *     x = 2*x
- *     for m in range(k+1, 0, -1):
+ *     for m in range(k+1):
  */
   __pyx_v_b0 = 0;
 
@@ -558,7 +574,7 @@
  *     b1 = -1
  *     b0 = 0
  *     x = 2*x             # <<<<<<<<<<<<<<
- *     for m in range(k+1, 0, -1):
+ *     for m in range(k+1):
  *         b2 = b1
  */
   __pyx_v_x = (2 * __pyx_v_x);
@@ -566,16 +582,17 @@
   /* "/home/pauli/wrk/scipy/scipy/scipy/special/orthogonal_eval.pyx":33
  *     b0 = 0
  *     x = 2*x
- *     for m in range(k+1, 0, -1):             # <<<<<<<<<<<<<<
+ *     for m in range(k+1):             # <<<<<<<<<<<<<<
  *         b2 = b1
  *         b1 = b0
  */
-  for (__pyx_t_1 = (__pyx_v_k + 1); __pyx_t_1 > 0; __pyx_t_1-=1) {
-    __pyx_v_m = __pyx_t_1;
+  __pyx_t_1 = (__pyx_v_k + 1);
+  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+    __pyx_v_m = __pyx_t_2;
 
     /* "/home/pauli/wrk/scipy/scipy/scipy/special/orthogonal_eval.pyx":34
  *     x = 2*x
- *     for m in range(k+1, 0, -1):
+ *     for m in range(k+1):
  *         b2 = b1             # <<<<<<<<<<<<<<
  *         b1 = b0
  *         b0 = x*b1 - b2
@@ -583,7 +600,7 @@
     __pyx_v_b2 = __pyx_v_b1;
 
     /* "/home/pauli/wrk/scipy/scipy/scipy/special/orthogonal_eval.pyx":35
- *     for m in range(k+1, 0, -1):
+ *     for m in range(k+1):
  *         b2 = b1
  *         b1 = b0             # <<<<<<<<<<<<<<
  *         b0 = x*b1 - b2
@@ -613,7 +630,6 @@
 
   __pyx_r = 0;
   __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -621,7 +637,7 @@
  *                                    int identity, char* name, char* doc, int c)
  * 
  * cdef void _loop_id_d(char **args, npy_intp *dimensions, npy_intp *steps,             # <<<<<<<<<<<<<<
- *                      void *func):
+ *                      void *func) nogil:
  *     cdef int i
  */
 
@@ -632,14 +648,13 @@
   char *__pyx_v_op;
   npy_intp __pyx_t_1;
   int __pyx_t_2;
-  __Pyx_RefNannySetupContext("_loop_id_d");
 
   /* "/home/pauli/wrk/scipy/scipy/scipy/special/orthogonal_eval.pyx":61
  *     cdef int i
  *     cdef double x
  *     cdef char *ip1=args[0], *ip2=args[1], *op=args[2]             # <<<<<<<<<<<<<<
  *     for i in range(0, dimensions[0]):
- *         (<double*>op)[0] = (<double(*)(long,double)>func)(
+ *         (<double*>op)[0] = (<double(*)(long,double) nogil>func)(
  */
   __pyx_v_ip1 = (__pyx_v_args[0]);
   __pyx_v_ip2 = (__pyx_v_args[1]);
@@ -649,7 +664,7 @@
  *     cdef double x
  *     cdef char *ip1=args[0], *ip2=args[1], *op=args[2]
  *     for i in range(0, dimensions[0]):             # <<<<<<<<<<<<<<
- *         (<double*>op)[0] = (<double(*)(long,double)>func)(
+ *         (<double*>op)[0] = (<double(*)(long,double) nogil>func)(
  *             (<long*>ip1)[0], (<double*>ip2)[0])
  */
   __pyx_t_1 = (__pyx_v_dimensions[0]);
@@ -659,14 +674,14 @@
     /* "/home/pauli/wrk/scipy/scipy/scipy/special/orthogonal_eval.pyx":63
  *     cdef char *ip1=args[0], *ip2=args[1], *op=args[2]
  *     for i in range(0, dimensions[0]):
- *         (<double*>op)[0] = (<double(*)(long,double)>func)(             # <<<<<<<<<<<<<<
+ *         (<double*>op)[0] = (<double(*)(long,double) nogil>func)(             # <<<<<<<<<<<<<<
  *             (<long*>ip1)[0], (<double*>ip2)[0])
  *         ip1 += steps[0]; ip2 += steps[1]; op += steps[2]
  */
     (((double *)__pyx_v_op)[0]) = ((double (*)(long, double))__pyx_v_func)((((long *)__pyx_v_ip1)[0]), (((double *)__pyx_v_ip2)[0]));
 
     /* "/home/pauli/wrk/scipy/scipy/scipy/special/orthogonal_eval.pyx":65
- *         (<double*>op)[0] = (<double(*)(long,double)>func)(
+ *         (<double*>op)[0] = (<double(*)(long,double) nogil>func)(
  *             (<long*>ip1)[0], (<double*>ip2)[0])
  *         ip1 += steps[0]; ip2 += steps[1]; op += steps[2]             # <<<<<<<<<<<<<<
  * 
@@ -677,7 +692,6 @@
     __pyx_v_op += (__pyx_v_steps[2]);
   }
 
-  __Pyx_RefNannyFinishContext();
 }
 
 /* "/home/pauli/wrk/scipy/scipy/scipy/special/orthogonal_eval.pyx":96
@@ -4376,7 +4390,7 @@
     return -1;
 }
 
-static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
     PyErr_Format(PyExc_ValueError,
         #if PY_VERSION_HEX < 0x02050000
                  "need more than %d value%s to unpack", (int)index,
@@ -4386,7 +4400,7 @@
                  (index == 1) ? "" : "s");
 }
 
-static INLINE void __Pyx_RaiseTooManyValuesError(void) {
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) {
     PyErr_SetString(PyExc_ValueError, "too many values to unpack");
 }
 
@@ -4454,7 +4468,7 @@
     return result;
 }
 
-static INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) {
+static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) {
     const npy_intp neg_one = (npy_intp)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(npy_intp) <  sizeof(long)) {
@@ -4472,7 +4486,7 @@
     }
 }
 
-static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
     PyObject *tmp_type, *tmp_value, *tmp_tb;
     PyThreadState *tstate = PyThreadState_GET();
 
@@ -4487,7 +4501,7 @@
     Py_XDECREF(tmp_tb);
 }
 
-static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
     PyThreadState *tstate = PyThreadState_GET();
     *type = tstate->curexc_type;
     *value = tstate->curexc_value;
@@ -4609,7 +4623,7 @@
 }
 #endif
 
-static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
+static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
     const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(unsigned char) < sizeof(long)) {
@@ -4628,7 +4642,7 @@
     return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
 }
 
-static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
+static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
     const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(unsigned short) < sizeof(long)) {
@@ -4647,7 +4661,7 @@
     return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
 }
 
-static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
+static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
     const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(unsigned int) < sizeof(long)) {
@@ -4666,7 +4680,7 @@
     return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
 }
 
-static INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
+static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
     const char neg_one = (char)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(char) < sizeof(long)) {
@@ -4685,7 +4699,7 @@
     return (char)__Pyx_PyInt_AsLong(x);
 }
 
-static INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
+static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
     const short neg_one = (short)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(short) < sizeof(long)) {
@@ -4704,7 +4718,7 @@
     return (short)__Pyx_PyInt_AsLong(x);
 }
 
-static INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
+static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
     const int neg_one = (int)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(int) < sizeof(long)) {
@@ -4723,7 +4737,7 @@
     return (int)__Pyx_PyInt_AsLong(x);
 }
 
-static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
+static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
     const signed char neg_one = (signed char)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(signed char) < sizeof(long)) {
@@ -4742,7 +4756,7 @@
     return (signed char)__Pyx_PyInt_AsSignedLong(x);
 }
 
-static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
+static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
     const signed short neg_one = (signed short)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(signed short) < sizeof(long)) {
@@ -4761,7 +4775,7 @@
     return (signed short)__Pyx_PyInt_AsSignedLong(x);
 }
 
-static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
+static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
     const signed int neg_one = (signed int)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
     if (sizeof(signed int) < sizeof(long)) {
@@ -4780,7 +4794,7 @@
     return (signed int)__Pyx_PyInt_AsSignedLong(x);
 }
 
-static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
+static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
     const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
@@ -4815,7 +4829,7 @@
     }
 }
 
-static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
+static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
     const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
@@ -4850,7 +4864,7 @@
     }
 }
 
-static INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
+static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
     const long neg_one = (long)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
@@ -4885,7 +4899,7 @@
     }
 }
 
-static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
+static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
     const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
@@ -4920,7 +4934,7 @@
     }
 }
 
-static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
+static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
     const signed long neg_one = (signed long)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
@@ -4955,7 +4969,7 @@
     }
 }
 
-static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
+static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
     const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
@@ -5092,13 +5106,13 @@
 
 /* Type Conversion Functions */
 
-static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
    if (x == Py_True) return 1;
    else if ((x == Py_False) | (x == Py_None)) return 0;
    else return PyObject_IsTrue(x);
 }
 
-static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
   PyNumberMethods *m;
   const char *name = NULL;
   PyObject *res = NULL;
@@ -5144,7 +5158,7 @@
   return res;
 }
 
-static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
   Py_ssize_t ival;
   PyObject* x = PyNumber_Index(b);
   if (!x) return -1;
@@ -5153,7 +5167,7 @@
   return ival;
 }
 
-static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
 #if PY_VERSION_HEX < 0x02050000
    if (ival <= LONG_MAX)
        return PyInt_FromLong((long)ival);
@@ -5167,7 +5181,7 @@
 #endif
 }
 
-static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
+static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
    unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
    if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
        return (size_t)-1;




More information about the Scipy-svn mailing list