/* Generated by Cython 0.29.24 */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_24"
#define CYTHON_HEX_VERSION 0x001D18F0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if defined(PyUnicode_IS_READY)
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #else
  #define __Pyx_PyUnicode_READY(op)       (0)
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  #endif
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#define __PYX_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__bpf4__core
#define __PYX_HAVE_API__bpf4__core
/* Early includes */
#include "math.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include "pythread.h"
#include "numpy/arrayobject.h"
#include "numpy/ndarrayobject.h"
#include "numpy/ndarraytypes.h"
#include "numpy/arrayscalars.h"
#include "numpy/ufuncobject.h"

    /* NumPy API declarations from "numpy/__init__.pxd" */
    
#include "pystate.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 1
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING "ascii"
#define __Pyx_PyObject_FromString __Pyx_PyStr_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyStr_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;

/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif


static const char *__pyx_f[] = {
  "bpf4/core.pyx",
  "__init__.pxd",
  "stringsource",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
};
/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()

/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
  struct __pyx_memoryview_obj *memview;
  char *data;
  Py_ssize_t shape[8];
  Py_ssize_t strides[8];
  Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
#define __Pyx_MemoryView_Len(m)  (m.shape[0])

/* Atomics.proto */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __pyx_atomic_int_type int
#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
                    !defined(__i386__)
    #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
    #include <Windows.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type LONG
    #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
    #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
    #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
    #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using Intel atomics"
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
    #define __pyx_add_acquisition_count(memview)\
             __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
#else
    #define __pyx_add_acquisition_count(memview)\
            __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif

/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  struct __Pyx_StructField_* fields;
  size_t size;
  size_t arraysize[8];
  int ndim;
  char typegroup;
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;

/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif


/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":690
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":691
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":692
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":693
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":697
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":698
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":699
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":700
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":704
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":705
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":714
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":715
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_long_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":716
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":718
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":719
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":720
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":722
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":723
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":725
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":726
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":727
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;

/* "bpf4/core.pyx":418
 * 
 * DTYPE = numpy.float #np.float64
 * ctypedef c_numpy.float_t DTYPE_t             # <<<<<<<<<<<<<<
 * 
 * # InterpolFunc
 */
typedef __pyx_t_5numpy_float_t __pyx_t_4bpf4_4core_DTYPE_t;
/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);


/*--- Type declarations ---*/
struct __pyx_obj_4bpf4_4core_BpfInterface;
struct __pyx_obj_4bpf4_4core_BpfBase;
struct __pyx_obj_4bpf4_4core_Linear;
struct __pyx_obj_4bpf4_4core_Smooth;
struct __pyx_obj_4bpf4_4core_Smoother;
struct __pyx_obj_4bpf4_4core_Halfcos;
struct __pyx_obj_4bpf4_4core_Halfcosm;
struct __pyx_obj_4bpf4_4core_Expon;
struct __pyx_obj_4bpf4_4core_Exponm;
struct __pyx_obj_4bpf4_4core_NoInterpol;
struct __pyx_obj_4bpf4_4core_Nearest;
struct __pyx_obj_4bpf4_4core_Sampled;
struct __pyx_obj_4bpf4_4core_Spline;
struct __pyx_obj_4bpf4_4core_USpline;
struct __pyx_obj_4bpf4_4core__BpfConcat2;
struct __pyx_obj_4bpf4_4core_Slope;
struct __pyx_obj_4bpf4_4core__BpfCompose;
struct __pyx_obj_4bpf4_4core__BpfConcat;
struct __pyx_obj_4bpf4_4core__BpfBlend;
struct __pyx_obj_4bpf4_4core__BpfBlendConst;
struct __pyx_obj_4bpf4_4core_Multi;
struct __pyx_obj_4bpf4_4core__FunctionWrap_Object;
struct __pyx_obj_4bpf4_4core__FunctionWrap_Object_OutboundConst;
struct __pyx_obj_4bpf4_4core_Const;
struct __pyx_obj_4bpf4_4core__BpfBinOp;
struct __pyx_obj_4bpf4_4core__BpfUnaryFunc;
struct __pyx_obj_4bpf4_4core__BpfUnaryOp;
struct __pyx_obj_4bpf4_4core__BpfBinOpConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaAdd;
struct __pyx_obj_4bpf4_4core__BpfLambdaAddConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaSub;
struct __pyx_obj_4bpf4_4core__BpfLambdaRSub;
struct __pyx_obj_4bpf4_4core__BpfLambdaSubConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaRSubConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaMul;
struct __pyx_obj_4bpf4_4core__BpfLambdaMulConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaPow;
struct __pyx_obj_4bpf4_4core__BpfLambdaPowConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaRPowConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaDiv;
struct __pyx_obj_4bpf4_4core__BpfLambdaDivConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaMod;
struct __pyx_obj_4bpf4_4core__BpfLambdaModConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaRDiv;
struct __pyx_obj_4bpf4_4core__BpfLambdaRDivConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThan;
struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThan;
struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThanConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThan;
struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThanConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThan;
struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThanConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaEqual;
struct __pyx_obj_4bpf4_4core__BpfLambdaEqualConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaUnequal;
struct __pyx_obj_4bpf4_4core__BpfLambdaUnequalConst;
struct __pyx_obj_4bpf4_4core__BpfMaxConst;
struct __pyx_obj_4bpf4_4core__BpfMinConst;
struct __pyx_obj_4bpf4_4core__BpfLambdaLog;
struct __pyx_obj_4bpf4_4core__BpfLambdaRound;
struct __pyx_obj_4bpf4_4core__BpfRand;
struct __pyx_obj_4bpf4_4core__BpfM2F;
struct __pyx_obj_4bpf4_4core__BpfF2M;
struct __pyx_obj_4bpf4_4core__Bpf_db2amp;
struct __pyx_obj_4bpf4_4core__Bpf_amp2db;
struct __pyx_obj_4bpf4_4core__BpfLambdaClip;
struct __pyx_obj_4bpf4_4core__BpfDeriv;
struct __pyx_obj_4bpf4_4core__BpfInverted;
struct __pyx_obj_4bpf4_4core__BpfIntegrate;
struct __pyx_obj_4bpf4_4core__BpfPeriodic;
struct __pyx_obj_4bpf4_4core__BpfProjection;
struct __pyx_obj_4bpf4_4core__BpfKeepSlope;
struct __pyx_obj_4bpf4_4core__BpfCrop;
struct __pyx_obj_4bpf4_4core__MultipleBpfs;
struct __pyx_obj_4bpf4_4core_Max;
struct __pyx_obj_4bpf4_4core_Min;
struct __pyx_obj_4bpf4_4core__BpfSelect;
struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments;
struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments;
struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments;
struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments;
struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments;
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py;
struct __pyx_array_obj;
struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":729
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":730
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":731
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":733
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;
struct __pyx_t_4bpf4_4core_InterpolFunc;
typedef struct __pyx_t_4bpf4_4core_InterpolFunc __pyx_t_4bpf4_4core_InterpolFunc;
struct __pyx_opt_args_4bpf4_4core_InterpolFunc_new_from_descriptor;
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled;
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sample_between;
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled_between;
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between;
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map;
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_log;
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_clip;
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_trapz_integrate_between;
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between;
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_zeros;
struct __pyx_opt_args_4bpf4_4core_7BpfBase_mapn_between;
struct __pyx_opt_args_4bpf4_4core_7BpfBase__mapn_between;
struct __pyx_opt_args_4bpf4_4core_6Linear_integrate_between;
struct __pyx_t_4bpf4_4core_SplineS;
typedef struct __pyx_t_4bpf4_4core_SplineS __pyx_t_4bpf4_4core_SplineS;
struct __pyx_opt_args_4bpf4_4core_SplineS_new;
struct __pyx_opt_args_4bpf4_4core_7Sampled_mapn_between;
struct __pyx_opt_args_4bpf4_4core_7Sampled_integrate_between;
struct __pyx_opt_args_4bpf4_4core_7USpline_map;
struct __pyx_opt_args_4bpf4_4core_7USpline_mapn_between;
struct __pyx_opt_args_4bpf4_4core_5Slope_mapn_between;
struct __pyx_opt_args_4bpf4_4core_11_BpfCompose_mapn_between;
struct __pyx_opt_args_4bpf4_4core_10_BpfConcat_concat;
struct __pyx_opt_args_4bpf4_4core_20_FunctionWrap_Object_map;
struct __pyx_opt_args_4bpf4_4core_20_FunctionWrap_Object_mapn_between;
struct __pyx_opt_args_4bpf4_4core_5Const_mapn_between;
struct __pyx_opt_args_4bpf4_4core__create_rlambda;
struct __pyx_opt_args_4bpf4_4core_9_BpfBinOp_mapn_between;
struct __pyx_opt_args_4bpf4_4core_9_BpfBinOp_map;
struct __pyx_opt_args_4bpf4_4core_13_BpfUnaryFunc_mapn_between;
struct __pyx_opt_args_4bpf4_4core_13_BpfUnaryFunc_map;
struct __pyx_opt_args_4bpf4_4core_11_BpfUnaryOp_mapn_between;
struct __pyx_opt_args_4bpf4_4core_11_BpfUnaryOp_map;
struct __pyx_opt_args_4bpf4_4core_14_BpfBinOpConst_map;
struct __pyx_opt_args_4bpf4_4core_13_BpfLambdaAdd_integrate_between;
struct __pyx_opt_args_4bpf4_4core_18_BpfLambdaAddConst_integrate_between;
struct __pyx_opt_args_4bpf4_4core_13_BpfLambdaSub_integrate_between;
struct __pyx_opt_args_4bpf4_4core_14_BpfLambdaRSub_integrate_between;
struct __pyx_opt_args_4bpf4_4core_18_BpfLambdaSubConst_integrate_between;
struct __pyx_opt_args_4bpf4_4core_19_BpfLambdaRSubConst_integrate_between;
struct __pyx_opt_args_4bpf4_4core_18_BpfLambdaMulConst_integrate_between;
struct __pyx_opt_args_4bpf4_4core_14_BpfLambdaClip_mapn_between;
struct __pyx_opt_args_4bpf4_4core_13_BpfIntegrate_mapn_between;
struct __pyx_opt_args_4bpf4_4core_8_BpfCrop_integrate_between;
struct __pyx_opt_args_4bpf4_4core_8_BpfCrop_mapn_between;
struct __pyx_opt_args_4bpf4_4core__BpfCrop_new;
struct __pyx_opt_args_4bpf4_4core_blend;
struct __pyx_opt_args_4bpf4_4core_bpf_zero_crossings;
struct __pyx_opt_args_4bpf4_4core_integrate_simpsons;

/* "bpf4/core.pyx":383
 * 
 * # ---------------------------- TYPES
 * ctypedef double(*t_unfunc)(double) nogil             # <<<<<<<<<<<<<<
 * 
 * cdef t_unfunc UNFUNCS[14]
 */
typedef double (*__pyx_t_4bpf4_4core_t_unfunc)(double);

/* "bpf4/core.pyx":405
 * ]
 * 
 * ctypedef double(*t_func0)(double, double, double, double, double, double) nogil             # <<<<<<<<<<<<<<
 * ctypedef double(*t_func)(InterpolFunc *, double, double, double, double, double) nogil
 * 
 */
typedef double (*__pyx_t_4bpf4_4core_t_func0)(double, double, double, double, double, double);

/* "bpf4/core.pyx":406
 * 
 * ctypedef double(*t_func0)(double, double, double, double, double, double) nogil
 * ctypedef double(*t_func)(InterpolFunc *, double, double, double, double, double) nogil             # <<<<<<<<<<<<<<
 * 
 * ctypedef struct InterpolFunc:
 */
typedef double (*__pyx_t_4bpf4_4core_t_func)(__pyx_t_4bpf4_4core_InterpolFunc *, double, double, double, double, double);

/* "bpf4/core.pyx":111
 * #       INLINE FUNCS
 * # -------------------------------------------------------------------
 * ctypedef struct InterpolFunc             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
struct __pyx_t_4bpf4_4core_InterpolFunc {
  __pyx_t_4bpf4_4core_t_func func;
  double exp;
  int numiter;
  double mix;
  __pyx_t_4bpf4_4core_InterpolFunc *blend_func;
  char *name;
  unsigned int needs_free;
};

/* "bpf4/core.pyx":443
 *     return out
 * 
 * cdef InterpolFunc* InterpolFunc_new_from_descriptor(str descr, int forcenew=0):             # <<<<<<<<<<<<<<
 *     cdef InterpolFunc* out = NULL
 *     cdef double exp = 1.0
 */
struct __pyx_opt_args_4bpf4_4core_InterpolFunc_new_from_descriptor {
  int __pyx_n;
  int forcenew;
};

/* "bpf4/core.pyx":978
 *         plot.plot_coords(xs, ys, kind=kind, show=show, axes=axes, **keys)
 * 
 *     cpdef BpfInterface sampled(self, double dx, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Sample this bpf at a regular interval, returns a Sampled bpf
 */
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled {
  int __pyx_n;
  PyObject *interpolation;
};

/* "bpf4/core.pyx":1015
 *         return Sampled(ys, dx=dx, x0=self._x0, interpolation=interpolation)
 * 
 *     cpdef ndarray sample_between(self, double x0, double x1, double dx, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sample this bpf at an interval of dx between x0 and x1
 */
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sample_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":1049
 *         return self.mapn_between(n, x0, x1, out)
 * 
 *     cpdef BpfInterface sampled_between(self, double x0, double x1, double dx, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Sample a portion of this bpf, returns a `Sampled` bpf
 */
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled_between {
  int __pyx_n;
  PyObject *interpolation;
};

/* "bpf4/core.pyx":1072
 *         return Sampled(ys, dx=dx, x0=x0, interpolation=interpolation)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate an array of `n` values representing this bpf between `x0` and `x1`
 */
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":1106
 *         return numpy.asarray(result)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         The same as map(self, xs) but faster
 */
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":1256
 *         return _BpfUnaryFunc_new_from_index(self, 13)
 * 
 *     cpdef _BpfLambdaLog log(self, double base=M_E):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing the log of this bpf
 */
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_log {
  int __pyx_n;
  double base;
};

/* "bpf4/core.pyx":1342
 *         return _Bpf_amp2db(self)
 * 
 *     cpdef _BpfLambdaClip clip(self, double y0=INFNEG, double y1=INF):             # <<<<<<<<<<<<<<
 *         """
 *         Return a bpf clipping the result between y0 and y1
 */
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_clip {
  int __pyx_n;
  double y0;
  double y1;
};

/* "bpf4/core.pyx":1452
 *         return self.integrate_between(self._x0, self._x1)
 * 
 *     cpdef double trapz_integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between [x0, x1] using the trapt method
 */
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_trapz_integrate_between {
  int __pyx_n;
  size_t N;
};

/* "bpf4/core.pyx":1476
 *         return _integr_trapz(&ys[0], ys.shape[0], dx)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between x0 and x1
 */
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between {
  int __pyx_n;
  size_t N;
};

/* "bpf4/core.pyx":1529
 *         return self.integrate() / (self._x1 - self._x0)
 * 
 *     cpdef list zeros(self, double h=0.01, int N=0, double x0=NAN, double x1=NAN, int maxzeros=0):             # <<<<<<<<<<<<<<
 *         """
 *         Find the zeros of this bpf
 */
struct __pyx_opt_args_4bpf4_4core_12BpfInterface_zeros {
  int __pyx_n;
  double h;
  int N;
  double x0;
  double x1;
  int maxzeros;
};

/* "bpf4/core.pyx":2136
 *         return res
 * 
 *     cpdef ndarray mapn_between(self, int n, double xstart, double xend, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)
 *         cdef double dx = _ntodx(n, xstart, xend)
 */
struct __pyx_opt_args_4bpf4_4core_7BpfBase_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":2183
 *         return numpy.asarray(result)
 * 
 *     cpdef ndarray _mapn_between(self, int n, double xstart, double xend, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
struct __pyx_opt_args_4bpf4_4core_7BpfBase__mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":2385
 *         return self.xs, self.ys
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between the given x coords
 */
struct __pyx_opt_args_4bpf4_4core_6Linear_integrate_between {
  int __pyx_n;
  size_t N;
};

/* "bpf4/core.pyx":2737
 * 
 * 
 * ctypedef struct SplineS:             # <<<<<<<<<<<<<<
 *     int use_low_slope
 *     int use_high_slope
 */
struct __pyx_t_4bpf4_4core_SplineS {
  int use_low_slope;
  int use_high_slope;
  double low_slope;
  double high_slope;
  __pyx_t_4bpf4_4core_DTYPE_t *xs;
  __pyx_t_4bpf4_4core_DTYPE_t *ys;
  __pyx_t_4bpf4_4core_DTYPE_t *ys2;
  int length;
  npy_intp last_index;
};

/* "bpf4/core.pyx":2749
 * 
 * 
 * cdef SplineS* SplineS_new(xs, ys, Py_ssize_t xs_size, double low_slope=0, double high_slope=0, int use_low_slope=0, int use_high_slope=0):             # <<<<<<<<<<<<<<
 *     cdef SplineS *s = <SplineS *>malloc(sizeof(SplineS))
 *     cdef int length = xs_size
 */
struct __pyx_opt_args_4bpf4_4core_SplineS_new {
  int __pyx_n;
  double low_slope;
  double high_slope;
  int use_low_slope;
  int use_high_slope;
};

/* "bpf4/core.pyx":3000
 * 
 *     @cython.cdivision(True)
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
struct __pyx_opt_args_4bpf4_4core_7Sampled_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":3113
 *         return _integr_trapz(self.data, self.samples_size, self.grid_dx)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         The same as integrate() but between the (included) bounds x0-x1
 */
struct __pyx_opt_args_4bpf4_4core_7Sampled_integrate_between {
  int __pyx_n;
  size_t N;
};

/* "bpf4/core.pyx":3339
 *             return self.spline__call__(x)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if out is not None:
 *             out[...] = self.spline__call__(xs)
 */
struct __pyx_opt_args_4bpf4_4core_7USpline_map {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":3346
 *             return self.spline__call__(xs)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
struct __pyx_opt_args_4bpf4_4core_7USpline_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":3466
 *             return _create_rlambda(a, b, _BpfLambdaSub, _BpfLambdaSubConst, _BpfLambdaRSub, _BpfLambdaRSubConst)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
struct __pyx_opt_args_4bpf4_4core_5Slope_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":3530
 *         self._set_bounds(self.a._x0, self.a._x1)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
struct __pyx_opt_args_4bpf4_4core_11_BpfCompose_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":3637
 *             return self.last_bpf.__ccall__(x)
 * 
 *     cpdef BpfInterface concat(self, BpfInterface other, double fadetime=0, fadeshape='expon(3)'):             # <<<<<<<<<<<<<<
 *         cdef BpfInterface other2 = other.fit_between(self._x1, self._x1 + (other._x1 - other._x0))
 *         cdef int i
 */
struct __pyx_opt_args_4bpf4_4core_10_BpfConcat_concat {
  int __pyx_n;
  double fadetime;
  PyObject *fadeshape;
};

/* "bpf4/core.pyx":3817
 * 
 * 
 * ctypedef double(*dfunc)(double) nogil             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef double (*__pyx_t_4bpf4_4core_dfunc)(double);

/* "bpf4/core.pyx":3846
 *         return _FunctionWrap_Object_OutboundConst_new(self, x0, x1)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
struct __pyx_opt_args_4bpf4_4core_20_FunctionWrap_Object_map {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":3904
 *         return result
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         xs = numpy.linspace(x0, x1, n)
 *         return self.map(xs, out=out)
 */
struct __pyx_opt_args_4bpf4_4core_20_FunctionWrap_Object_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":3968
 *         return out
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if out is not None:
 *             out[...] = self.value
 */
struct __pyx_opt_args_4bpf4_4core_5Const_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":4003
 *     return out
 * 
 * cdef _create_rlambda(object a, object b, class_bin, class_const, class_rbin=None, class_rconst=None):             # <<<<<<<<<<<<<<
 *     if isinstance(a, BpfInterface):
 *         if isinstance(b, BpfInterface):
 */
struct __pyx_opt_args_4bpf4_4core__create_rlambda {
  int __pyx_n;
  PyObject *class_rbin;
  PyObject *class_rconst;
};

/* "bpf4/core.pyx":4046
 *         pass
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = <ndarray>out if out is not None else EMPTY1D(n)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(n)
 */
struct __pyx_opt_args_4bpf4_4core_9_BpfBinOp_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":4058
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
struct __pyx_opt_args_4bpf4_4core_9_BpfBinOp_map {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":4101
 *         return self.func(self.a.__ccall__(x))
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         cdef t_unfunc func = self.func
 */
struct __pyx_opt_args_4bpf4_4core_13_BpfUnaryFunc_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":4108
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
struct __pyx_opt_args_4bpf4_4core_13_BpfUnaryFunc_map {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":4172
 *         pass
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         with nogil:
 */
struct __pyx_opt_args_4bpf4_4core_11_BpfUnaryOp_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":4178
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
struct __pyx_opt_args_4bpf4_4core_11_BpfUnaryOp_map {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":4217
 *         pass
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
struct __pyx_opt_args_4bpf4_4core_14_BpfBinOpConst_map {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":4260
 *             A[i] += B[i]
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) + self.b.integrate_between(x0, x1, N)
 * 
 */
struct __pyx_opt_args_4bpf4_4core_13_BpfLambdaAdd_integrate_between {
  int __pyx_n;
  size_t N;
};

/* "bpf4/core.pyx":4284
 *                 return _BpfBinOpConst.__add__(b, a)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) + (x1 - x0) * self.b_const
 * 
 */
struct __pyx_opt_args_4bpf4_4core_18_BpfLambdaAddConst_integrate_between {
  int __pyx_n;
  size_t N;
};

/* "bpf4/core.pyx":4292
 *         for i in range(n):
 *             A[i] -= B[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) - self.b.integrate_between(x0, x1, N)
 * 
 */
struct __pyx_opt_args_4bpf4_4core_13_BpfLambdaSub_integrate_between {
  int __pyx_n;
  size_t N;
};

/* "bpf4/core.pyx":4300
 *         for i in range(n):
 *             B[i] -= A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.b.integrate_between(x0, x1, N) - self.a.integrate_between(x0, x1, N)
 * 
 */
struct __pyx_opt_args_4bpf4_4core_14_BpfLambdaRSub_integrate_between {
  int __pyx_n;
  size_t N;
};

/* "bpf4/core.pyx":4308
 *         for i in range(n):
 *             A[i] -= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) - (x1-x0)*self.b_const
 * 
 */
struct __pyx_opt_args_4bpf4_4core_18_BpfLambdaSubConst_integrate_between {
  int __pyx_n;
  size_t N;
};

/* "bpf4/core.pyx":4316
 *         for i in range(n):
 *             A[i] = b - A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.b_const*(x1-x0) - self.a.integrate_between(x0, x1, N)
 * 
 */
struct __pyx_opt_args_4bpf4_4core_19_BpfLambdaRSubConst_integrate_between {
  int __pyx_n;
  size_t N;
};

/* "bpf4/core.pyx":4330
 *         for i in range(n):
 *             A[i] *= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) * self.b_const
 * 
 */
struct __pyx_opt_args_4bpf4_4core_18_BpfLambdaMulConst_integrate_between {
  int __pyx_n;
  size_t N;
};

/* "bpf4/core.pyx":4542
 *             return self.y0
 *         return y
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ndarray [DTYPE_t, ndim=1] result
 */
struct __pyx_opt_args_4bpf4_4core_14_BpfLambdaClip_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":4716
 * 
 *     @cython.cdivision(True)
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef double [::1] accums
 *         cdef double dx0, dx1, dy
 */
struct __pyx_opt_args_4bpf4_4core_13_BpfIntegrate_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":4901
 *         return _BpfCrop_new(self.bpf, self._x0, self._x1, OUTBOUND_SET, y0, y1)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         if x0 >= self.bpf._x0 and x1 <= self.bpf._x1:
 *             return self.bpf.integrate_between(x0, x1)
 */
struct __pyx_opt_args_4bpf4_4core_8_BpfCrop_integrate_between {
  int __pyx_n;
  size_t N;
};

/* "bpf4/core.pyx":4918
 *         return integr0 + integr1 + integr2
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if self.outbound_mode == OUTBOUND_DONOTHING:
 *             return self.bpf.mapn_between(n, x0, x1, out)
 */
struct __pyx_opt_args_4bpf4_4core_8_BpfCrop_mapn_between {
  int __pyx_n;
  PyArrayObject *out;
};

/* "bpf4/core.pyx":4965
 * 
 * 
 * cpdef _BpfCrop _BpfCrop_new(BpfInterface bpf, double x0, double x1, int outbound_mode,             # <<<<<<<<<<<<<<
 *                             double outbound0=0, double outbound1=0):
 *     """
 */
struct __pyx_opt_args_4bpf4_4core__BpfCrop_new {
  int __pyx_n;
  double outbound0;
  double outbound1;
};

/* "bpf4/core.pyx":5182
 * 
 * 
 * cpdef BpfInterface blend(a, b, mix=0.5):             # <<<<<<<<<<<<<<
 *     """
 *     Blend these BPFs
 */
struct __pyx_opt_args_4bpf4_4core_blend {
  int __pyx_n;
  PyObject *mix;
};

/* "bpf4/core.pyx":5316
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cpdef list bpf_zero_crossings(BpfInterface b, double h=0.01, int N=0,             # <<<<<<<<<<<<<<
 *                               double x0=NAN, double x1=NAN, int maxzeros=0):
 *     """
 */
struct __pyx_opt_args_4bpf4_4core_bpf_zero_crossings {
  int __pyx_n;
  double h;
  int N;
  double x0;
  double x1;
  int maxzeros;
};

/* "bpf4/core.pyx":5395
 *            _integrate_adaptive_simpsons_inner(f, c, b, epsilon / 2, Sright, fc, fb, fe, bottom - 1)
 * 
 * cdef double integrate_simpsons(BpfInterface f, double a, double b, double accuracy=10e-10, int max_iterations=50):             # <<<<<<<<<<<<<<
 *     cdef:
 *         double c = (a + b) / 2
 */
struct __pyx_opt_args_4bpf4_4core_integrate_simpsons {
  int __pyx_n;
  double accuracy;
  int max_iterations;
};

/* "bpf4/core.pyx":656
 * # ~~~~~~~~~~~~~~~~~~~ BpfInterface ~~~~~~~~~~~~~~~~~~~~~
 * 
 * cdef class BpfInterface:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for all Break-Point Functions
 */
struct __pyx_obj_4bpf4_4core_BpfInterface {
  PyObject_HEAD
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *__pyx_vtab;
  double _x0;
  double _x1;
  int _integration_mode;
};


/* "bpf4/core.pyx":2010
 * 
 * 
 * cdef class BpfBase(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef ndarray xs, ys
 *     cdef DTYPE_t* xs_data
 */
struct __pyx_obj_4bpf4_4core_BpfBase {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  PyArrayObject *xs;
  PyArrayObject *ys;
  __pyx_t_4bpf4_4core_DTYPE_t *xs_data;
  __pyx_t_4bpf4_4core_DTYPE_t *ys_data;
  int outbound_mode;
  double outbound0;
  double outbound1;
  double lastbin_x0;
  double lastbin_x1;
  __pyx_t_4bpf4_4core_InterpolFunc *interpol_func;
  Py_ssize_t xs_size;
  size_t lastbin_idx1;
};


/* "bpf4/core.pyx":2361
 * 
 * 
 * cdef class Linear(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with linear interpolation
 */
struct __pyx_obj_4bpf4_4core_Linear {
  struct __pyx_obj_4bpf4_4core_BpfBase __pyx_base;
};


/* "bpf4/core.pyx":2474
 * 
 * 
 * cdef class Smooth(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with smoothstep interpolation.
 */
struct __pyx_obj_4bpf4_4core_Smooth {
  struct __pyx_obj_4bpf4_4core_BpfBase __pyx_base;
};


/* "bpf4/core.pyx":2509
 * 
 * 
 * cdef class Smoother(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with smootherstep interpolation (perlin's variation of smoothstep)
 */
struct __pyx_obj_4bpf4_4core_Smoother {
  struct __pyx_obj_4bpf4_4core_BpfBase __pyx_base;
};


/* "bpf4/core.pyx":2529
 * 
 * 
 * cdef class Halfcos(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with half-cosine interpolation
 */
struct __pyx_obj_4bpf4_4core_Halfcos {
  struct __pyx_obj_4bpf4_4core_BpfBase __pyx_base;
};


/* "bpf4/core.pyx":2576
 * 
 * 
 * cdef class Halfcosm(Halfcos):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with half-cosine and exponent depending on the orientation of the interpolation
 */
struct __pyx_obj_4bpf4_4core_Halfcosm {
  struct __pyx_obj_4bpf4_4core_Halfcos __pyx_base;
};


/* "bpf4/core.pyx":2599
 * 
 * 
 * cdef class Expon(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with exponential interpolation
 */
struct __pyx_obj_4bpf4_4core_Expon {
  struct __pyx_obj_4bpf4_4core_BpfBase __pyx_base;
};


/* "bpf4/core.pyx":2645
 * 
 * 
 * cdef class Exponm(Expon):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with symmetrical exponential interpolation
 */
struct __pyx_obj_4bpf4_4core_Exponm {
  struct __pyx_obj_4bpf4_4core_Expon __pyx_base;
};


/* "bpf4/core.pyx":2680
 * 
 * 
 * cdef class NoInterpol(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf without interpolation
 */
struct __pyx_obj_4bpf4_4core_NoInterpol {
  struct __pyx_obj_4bpf4_4core_BpfBase __pyx_base;
};


/* "bpf4/core.pyx":2707
 * 
 * 
 * cdef class Nearest(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with nearest interpolation
 */
struct __pyx_obj_4bpf4_4core_Nearest {
  struct __pyx_obj_4bpf4_4core_BpfBase __pyx_base;
};


/* "bpf4/core.pyx":2839
 * 
 * 
 * cdef class Sampled(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with regularly sampled data
 */
struct __pyx_obj_4bpf4_4core_Sampled {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  PyArrayObject *ys;
  double y0;
  double y1;
  double grid_dx;
  double grid_x0;
  double grid_x1;
  int samples_size;
  int nointerpol;
  __pyx_t_4bpf4_4core_InterpolFunc *interpolfunc;
  __pyx_t_4bpf4_4core_DTYPE_t *data;
  PyArrayObject *_cached_xs;
};


/* "bpf4/core.pyx":3191
 * 
 * 
 * cdef class Spline(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with cubic spline interpolation
 */
struct __pyx_obj_4bpf4_4core_Spline {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  __pyx_t_4bpf4_4core_SplineS *_spline;
};


/* "bpf4/core.pyx":3295
 * 
 * 
 * cdef class USpline(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     bpf with univariate spline interpolation.
 */
struct __pyx_obj_4bpf4_4core_USpline {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  PyObject *spline;
  PyObject *spline__call__;
  PyArrayObject *xs;
  PyArrayObject *ys;
};


/* "bpf4/core.pyx":3389
 * 
 * 
 * cdef class _BpfConcat2(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface a
 *     cdef BpfInterface b
 */
struct __pyx_obj_4bpf4_4core__BpfConcat2 {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *a;
  struct __pyx_obj_4bpf4_4core_BpfInterface *b;
  double splitpoint;
};


/* "bpf4/core.pyx":3408
 * 
 * 
 * cdef class Slope(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing a linear equation `y = slope * x + offset`
 */
struct __pyx_obj_4bpf4_4core_Slope {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  double slope;
  double offset;
};


/* "bpf4/core.pyx":3512
 * 
 * 
 * cdef class _BpfCompose(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing function composition `f(x) = b(a(x))`
 */
struct __pyx_obj_4bpf4_4core__BpfCompose {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *a;
  struct __pyx_obj_4bpf4_4core_BpfInterface *b;
};


/* "bpf4/core.pyx":3576
 * 
 * 
 * cdef class _BpfConcat(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing the concatenation of multiple bpfs
 */
struct __pyx_obj_4bpf4_4core__BpfConcat {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  PyObject *bpfs;
  double *xs;
  Py_ssize_t size;
  double last_x0;
  double last_x1;
  struct __pyx_obj_4bpf4_4core_BpfInterface *last_bpf;
  struct __pyx_obj_4bpf4_4core_BpfInterface *bpf0;
  struct __pyx_obj_4bpf4_4core_BpfInterface *bpf1;
};


/* "bpf4/core.pyx":3656
 * 
 * 
 * cdef class _BpfBlend(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface a, b
 *     cdef BpfInterface which
 */
struct __pyx_obj_4bpf4_4core__BpfBlend {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *a;
  struct __pyx_obj_4bpf4_4core_BpfInterface *b;
  struct __pyx_obj_4bpf4_4core_BpfInterface *which;
};


/* "bpf4/core.pyx":3686
 * 
 * 
 * cdef class _BpfBlendConst(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface a, b
 *     cdef double which
 */
struct __pyx_obj_4bpf4_4core__BpfBlendConst {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *a;
  struct __pyx_obj_4bpf4_4core_BpfInterface *b;
  double which;
};


/* "bpf4/core.pyx":3710
 * 
 * 
 * cdef class Multi(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf where each segment can have its own interpolation kind
 */
struct __pyx_obj_4bpf4_4core_Multi {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  __pyx_t_4bpf4_4core_DTYPE_t *xs;
  __pyx_t_4bpf4_4core_DTYPE_t *ys;
  __pyx_t_4bpf4_4core_InterpolFunc **interpolations;
  int size;
  __pyx_t_4bpf4_4core_DTYPE_t y0;
  __pyx_t_4bpf4_4core_DTYPE_t y1;
  __pyx_t_4bpf4_4core_DTYPE_t last_x0;
  __pyx_t_4bpf4_4core_DTYPE_t last_x1;
  __pyx_t_4bpf4_4core_DTYPE_t last_y0;
  __pyx_t_4bpf4_4core_DTYPE_t last_y1;
  __pyx_t_4bpf4_4core_InterpolFunc *last_interpol;
};


/* "bpf4/core.pyx":3824
 * 
 * 
 * cdef class _FunctionWrap_Object(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef object f
 * 
 */
struct __pyx_obj_4bpf4_4core__FunctionWrap_Object {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  PyObject *f;
};


/* "bpf4/core.pyx":3909
 * 
 * 
 * cdef class _FunctionWrap_Object_OutboundConst(_FunctionWrap_Object):             # <<<<<<<<<<<<<<
 *     cdef double y0, y1
 *     cdef double __ccall__(self, double x) nogil:
 */
struct __pyx_obj_4bpf4_4core__FunctionWrap_Object_OutboundConst {
  struct __pyx_obj_4bpf4_4core__FunctionWrap_Object __pyx_base;
  double y0;
  double y1;
};


/* "bpf4/core.pyx":3928
 * 
 * 
 * cdef class Const(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing a constant value
 */
struct __pyx_obj_4bpf4_4core_Const {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  double value;
};


/* "bpf4/core.pyx":4019
 *     return out
 * 
 * cdef class _BpfBinOp(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing a binary operation between two bpfs
 */
struct __pyx_obj_4bpf4_4core__BpfBinOp {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *a;
  struct __pyx_obj_4bpf4_4core_BpfInterface *b;
};


/* "bpf4/core.pyx":4081
 * 
 * 
 * cdef class _BpfUnaryFunc(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface a
 *     cdef t_unfunc func
 */
struct __pyx_obj_4bpf4_4core__BpfUnaryFunc {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *a;
  __pyx_t_4bpf4_4core_t_unfunc func;
  int funcindex;
};


/* "bpf4/core.pyx":4146
 * 
 * 
 * cdef class _BpfUnaryOp(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing a unary operation on a bpf
 */
struct __pyx_obj_4bpf4_4core__BpfUnaryOp {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *a;
};


/* "bpf4/core.pyx":4196
 * 
 * 
 * cdef class _BpfBinOpConst(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing a binary operation between a bpf and a constant value
 */
struct __pyx_obj_4bpf4_4core__BpfBinOpConst {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  double b_const;
  struct __pyx_obj_4bpf4_4core_BpfInterface *a;
};


/* "bpf4/core.pyx":4255
 * 
 * 
 * cdef class _BpfLambdaAdd(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaAdd {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4264
 * 
 * 
 * cdef class _BpfLambdaAddConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaAddConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4288
 * 
 * 
 * cdef class _BpfLambdaSub(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaSub {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4296
 * 
 * 
 * cdef class _BpfLambdaRSub(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaRSub {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4304
 * 
 * 
 * cdef class _BpfLambdaSubConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaSubConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4312
 * 
 * 
 * cdef class _BpfLambdaRSubConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaRSubConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4320
 * 
 * 
 * cdef class _BpfLambdaMul(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaMul {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4326
 * 
 * 
 * cdef class _BpfLambdaMulConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaMulConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4334
 * 
 * 
 * cdef class _BpfLambdaPow(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaPow {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4340
 * 
 * 
 * cdef class _BpfLambdaPowConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaPowConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4346
 * 
 * 
 * cdef class _BpfLambdaRPowConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaRPowConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4352
 * 
 * 
 * cdef class _BpfLambdaDiv(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaDiv {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4359
 * 
 * 
 * cdef class _BpfLambdaDivConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaDivConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4366
 * 
 * 
 * cdef class _BpfLambdaMod(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaMod {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4373
 * 
 * 
 * cdef class _BpfLambdaModConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaModConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4380
 * 
 * 
 * cdef class _BpfLambdaRDiv(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaRDiv {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4387
 * 
 * 
 * cdef class _BpfLambdaRDivConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaRDivConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4394
 * 
 * 
 * cdef class _BpfLambdaGreaterThan(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThan {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4400
 * 
 * 
 * cdef class _BpfLambdaGreaterOrEqualThan(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThan {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4406
 * 
 * 
 * cdef class _BpfLambdaGreaterThanConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThanConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4412
 * 
 * 
 * cdef class _BpfLambdaGreaterOrEqualThanConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4418
 * 
 * 
 * cdef class _BpfLambdaLowerThan(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThan {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4424
 * 
 * 
 * cdef class _BpfLambdaLowerThanConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThanConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4430
 * 
 * 
 * cdef class _BpfLambdaLowerOrEqualThan(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThan {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4436
 * 
 * 
 * cdef class _BpfLambdaLowerOrEqualThanConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThanConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4442
 * 
 * 
 * cdef class _BpfLambdaEqual(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaEqual {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4448
 * 
 * 
 * cdef class _BpfLambdaEqualConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaEqualConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4454
 * 
 * 
 * cdef class _BpfLambdaUnequal(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaUnequal {
  struct __pyx_obj_4bpf4_4core__BpfBinOp __pyx_base;
};


/* "bpf4/core.pyx":4460
 * 
 * 
 * cdef class _BpfLambdaUnequalConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaUnequalConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4466
 * 
 * 
 * cdef class _BpfMaxConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         cdef double y
 */
struct __pyx_obj_4bpf4_4core__BpfMaxConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4474
 * 
 * 
 * cdef class _BpfMinConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         cdef double y
 */
struct __pyx_obj_4bpf4_4core__BpfMinConst {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4482
 * 
 * 
 * cdef class _BpfLambdaLog(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     def __init__(_BpfBinOpConst self, BpfInterface a, double b, tuple bounds, str op=''):
 *         _BpfBinOpConst.__init__(self, a, b, bounds, op)
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaLog {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst __pyx_base;
};


/* "bpf4/core.pyx":4493
 * 
 * 
 * cdef class _BpfLambdaRound(_BpfUnaryOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaRound {
  struct __pyx_obj_4bpf4_4core__BpfUnaryOp __pyx_base;
};


/* "bpf4/core.pyx":4499
 * 
 * 
 * cdef class _BpfRand(_BpfUnaryOp):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 */
struct __pyx_obj_4bpf4_4core__BpfRand {
  struct __pyx_obj_4bpf4_4core__BpfUnaryOp __pyx_base;
};


/* "bpf4/core.pyx":4506
 * 
 * 
 * cdef class _BpfM2F(_BpfUnaryOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfM2F {
  struct __pyx_obj_4bpf4_4core__BpfUnaryOp __pyx_base;
};


/* "bpf4/core.pyx":4512
 * 
 * 
 * cdef class _BpfF2M(_BpfUnaryOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__BpfF2M {
  struct __pyx_obj_4bpf4_4core__BpfUnaryOp __pyx_base;
};


/* "bpf4/core.pyx":4518
 * 
 * 
 * cdef class _Bpf_db2amp(_BpfUnaryOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 */
struct __pyx_obj_4bpf4_4core__Bpf_db2amp {
  struct __pyx_obj_4bpf4_4core__BpfUnaryOp __pyx_base;
};


/* "bpf4/core.pyx":4524
 * 
 * 
 * cdef class _Bpf_amp2db(_BpfUnaryOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         cdef double x
 */
struct __pyx_obj_4bpf4_4core__Bpf_amp2db {
  struct __pyx_obj_4bpf4_4core__BpfUnaryOp __pyx_base;
};


/* "bpf4/core.pyx":4532
 * 
 * 
 * cdef class _BpfLambdaClip(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface bpf
 *     cdef double y0, y1
 */
struct __pyx_obj_4bpf4_4core__BpfLambdaClip {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *bpf;
  double y0;
  double y1;
};


/* "bpf4/core.pyx":4595
 * 
 * 
 * cdef class _BpfDeriv(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing the derivative of another bpf
 */
struct __pyx_obj_4bpf4_4core__BpfDeriv {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *bpf;
  double h;
};


/* "bpf4/core.pyx":4634
 * 
 * 
 * cdef class _BpfInverted(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface bpf
 *     cdef double bpf_x0, bpf_x1
 */
struct __pyx_obj_4bpf4_4core__BpfInverted {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *bpf;
  double bpf_x0;
  double bpf_x1;
};


/* "bpf4/core.pyx":4663
 * 
 * 
 * cdef class _BpfIntegrate(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing the integration of another bpf
 */
struct __pyx_obj_4bpf4_4core__BpfIntegrate {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *bpf;
  double bpf_at_x0;
  double width;
  double min_N_ratio;
  double Nexp;
  int N;
  int N0;
  int Nwidth;
  int debug;
  size_t oversample;
};


/* "bpf4/core.pyx":4748
 * 
 * 
 * cdef class _BpfPeriodic(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface bpf
 *     cdef double x0
 */
struct __pyx_obj_4bpf4_4core__BpfPeriodic {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *bpf;
  double x0;
  double period;
};


/* "bpf4/core.pyx":4772
 * 
 * 
 * cdef class _BpfProjection(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface bpf
 *     cdef double bpf_x0
 */
struct __pyx_obj_4bpf4_4core__BpfProjection {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *bpf;
  double bpf_x0;
  double dx;
  double rx;
  double offset;
};


/* "bpf4/core.pyx":4830
 * 
 * 
 * cdef class _BpfKeepSlope(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface bpf
 *     cdef double EPSILON
 */
struct __pyx_obj_4bpf4_4core__BpfKeepSlope {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *bpf;
  double EPSILON;
};


/* "bpf4/core.pyx":4857
 * 
 * 
 * cdef class _BpfCrop(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface bpf
 *     cdef readonly double _y0, _y1
 */
struct __pyx_obj_4bpf4_4core__BpfCrop {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *bpf;
  double _y0;
  double _y1;
  int outbound_mode;
};


/* "bpf4/core.pyx":4994
 * 
 * 
 * cdef class _MultipleBpfs(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef tuple _bpfs
 *     cdef void** bpfpointers
 */
struct __pyx_obj_4bpf4_4core__MultipleBpfs {
  struct __pyx_obj_4bpf4_4core_BpfInterface __pyx_base;
  PyObject *_bpfs;
  void **bpfpointers;
  struct __pyx_obj_4bpf4_4core_BpfInterface *tmp;
  int _numbpfs;
};


/* "bpf4/core.pyx":5030
 * 
 * 
 * cdef class Max(_MultipleBpfs):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf which returns the max of multiple bpfs at a given point
 */
struct __pyx_obj_4bpf4_4core_Max {
  struct __pyx_obj_4bpf4_4core__MultipleBpfs __pyx_base;
};


/* "bpf4/core.pyx":5061
 * 
 * 
 * cdef class Min(_MultipleBpfs):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf which returns the min of multiple bpfs at a given point
 */
struct __pyx_obj_4bpf4_4core_Min {
  struct __pyx_obj_4bpf4_4core__MultipleBpfs __pyx_base;
};


/* "bpf4/core.pyx":5093
 * 
 * 
 * cdef class _BpfSelect(_MultipleBpfs):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface which
 *     cdef InterpolFunc* func
 */
struct __pyx_obj_4bpf4_4core__BpfSelect {
  struct __pyx_obj_4bpf4_4core__MultipleBpfs __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *which;
  __pyx_t_4bpf4_4core_InterpolFunc *func;
  int numbpfs;
};


/* "bpf4/core.pyx":2333
 *         return self.clone_with_new_data(newxs, newys)
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return an iterator over the segments of this bpf
 */
struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments {
  PyObject_HEAD
  size_t __pyx_v_i;
  PyObject *__pyx_v_interpoltype;
  size_t __pyx_v_num_segments;
  struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self;
  size_t __pyx_t_0;
  size_t __pyx_t_1;
  size_t __pyx_t_2;
};


/* "bpf4/core.pyx":3074
 *         return self.xs, self.ys
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */
struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments {
  PyObject_HEAD
  PyObject *__pyx_v_descr;
  double __pyx_v_dx;
  double __pyx_v_exp;
  int __pyx_v_i;
  struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self;
  double __pyx_v_x0;
  int __pyx_t_0;
  int __pyx_t_1;
  int __pyx_t_2;
};


/* "bpf4/core.pyx":3269
 *         return self._points()
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */
struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments {
  PyObject_HEAD
  long __pyx_v_exp;
  size_t __pyx_v_i;
  PyObject *__pyx_v_interpoltype;
  size_t __pyx_v_num_segments;
  struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self;
  size_t __pyx_t_0;
  size_t __pyx_t_1;
  size_t __pyx_t_2;
};


/* "bpf4/core.pyx":3370
 *             return self.spline
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */
struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments {
  PyObject_HEAD
  long __pyx_v_exp;
  size_t __pyx_v_i;
  PyObject *__pyx_v_interpoltype;
  size_t __pyx_v_num_segments;
  struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self;
  size_t __pyx_t_0;
  size_t __pyx_t_1;
  size_t __pyx_t_2;
};


/* "bpf4/core.pyx":3800
 *         return res
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */
struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments {
  PyObject_HEAD
  __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_func;
  int __pyx_v_i;
  struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self;
  long __pyx_t_0;
  long __pyx_t_1;
  int __pyx_t_2;
};


/* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_double____double____nogil_to_py")
 * cdef object __Pyx_CFunc_double____double____nogil_to_py(double (*f)(double) except *):             # <<<<<<<<<<<<<<
 *     def wrap(double x):
 *         """wrap(x: float) -> float"""
 */
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py {
  PyObject_HEAD
  double (*__pyx_v_f)(double);
};


/* "View.MemoryView":105
 * 
 * @cname("__pyx_array")
 * cdef class array:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_array_obj {
  PyObject_HEAD
  struct __pyx_vtabstruct_array *__pyx_vtab;
  char *data;
  Py_ssize_t len;
  char *format;
  int ndim;
  Py_ssize_t *_shape;
  Py_ssize_t *_strides;
  Py_ssize_t itemsize;
  PyObject *mode;
  PyObject *_format;
  void (*callback_free_data)(void *);
  int free_data;
  int dtype_is_object;
};


/* "View.MemoryView":279
 * 
 * @cname('__pyx_MemviewEnum')
 * cdef class Enum(object):             # <<<<<<<<<<<<<<
 *     cdef object name
 *     def __init__(self, name):
 */
struct __pyx_MemviewEnum_obj {
  PyObject_HEAD
  PyObject *name;
};


/* "View.MemoryView":330
 * 
 * @cname('__pyx_memoryview')
 * cdef class memoryview(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef object obj
 */
struct __pyx_memoryview_obj {
  PyObject_HEAD
  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
  PyObject *obj;
  PyObject *_size;
  PyObject *_array_interface;
  PyThread_type_lock lock;
  __pyx_atomic_int acquisition_count[2];
  __pyx_atomic_int *acquisition_count_aligned_p;
  Py_buffer view;
  int flags;
  int dtype_is_object;
  __Pyx_TypeInfo *typeinfo;
};


/* "View.MemoryView":965
 * 
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
 *     "Internal class for passing memoryview slices to Python"
 * 
 */
struct __pyx_memoryviewslice_obj {
  struct __pyx_memoryview_obj __pyx_base;
  __Pyx_memviewslice from_slice;
  PyObject *from_object;
  PyObject *(*to_object_func)(char *);
  int (*to_dtype_func)(char *, PyObject *);
};



/* "View.MemoryView":105
 * 
 * @cname("__pyx_array")
 * cdef class array:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

struct __pyx_vtabstruct_array {
  PyObject *(*get_memview)(struct __pyx_array_obj *);
};
static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;


/* "bpf4/core.pyx":656
 * # ~~~~~~~~~~~~~~~~~~~ BpfInterface ~~~~~~~~~~~~~~~~~~~~~
 * 
 * cdef class BpfInterface:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for all Break-Point Functions
 */

struct __pyx_vtabstruct_4bpf4_4core_BpfInterface {
  struct __pyx_obj_4bpf4_4core_BpfInterface *(*_asbpf)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  void (*_bounds_changed)(struct __pyx_obj_4bpf4_4core_BpfInterface *);
  void (*_set_bounds)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double);
  void (*_set_bounds_like)(struct __pyx_obj_4bpf4_4core_BpfInterface *, struct __pyx_obj_4bpf4_4core_BpfInterface *);
  double (*ntodx)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, int __pyx_skip_dispatch);
  int (*dxton)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core_BpfInterface *(*sampled)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled *__pyx_optional_args);
  PyArrayObject *(*sample_between)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sample_between *__pyx_optional_args);
  struct __pyx_obj_4bpf4_4core_BpfInterface *(*sampled_between)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled_between *__pyx_optional_args);
  PyArrayObject *(*mapn_between)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args);
  PyArrayObject *(*map)(struct __pyx_obj_4bpf4_4core_BpfInterface *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map *__pyx_optional_args);
  struct __pyx_obj_4bpf4_4core_BpfInterface *(*concat)(struct __pyx_obj_4bpf4_4core_BpfInterface *, struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfLambdaRound *(*round)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfRand *(*rand)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*cos)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*sin)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*ceil)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*expon)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*floor)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*tanh)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*abs)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*sqrt)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*acos)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*asin)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*tan)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*sinh)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*log10)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfLambdaLog *(*log)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_log *__pyx_optional_args);
  struct __pyx_obj_4bpf4_4core__BpfM2F *(*m2f)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfF2M *(*f2m)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__Bpf_db2amp *(*db2amp)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__Bpf_amp2db *(*amp2db)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core__BpfLambdaClip *(*clip)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_clip *__pyx_optional_args);
  struct __pyx_obj_4bpf4_4core_BpfInterface *(*derivative)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core_BpfInterface *(*integrated)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  double (*integrate)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  double (*trapz_integrate_between)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_trapz_integrate_between *__pyx_optional_args);
  double (*integrate_between)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args);
  double (*mean)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch);
  PyObject *(*zeros)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_zeros *__pyx_optional_args);
  double (*__pyx___ccall__)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double);
  struct __pyx_obj_4bpf4_4core_BpfInterface *(*fit_between)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core_BpfInterface *(*shifted)(struct __pyx_obj_4bpf4_4core_BpfInterface *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_4bpf4_4core_BpfInterface *(*_slice)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *__pyx_vtabptr_4bpf4_4core_BpfInterface;
static CYTHON_INLINE void __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double);
static CYTHON_INLINE void __pyx_f_4bpf4_4core_12BpfInterface__set_bounds_like(struct __pyx_obj_4bpf4_4core_BpfInterface *, struct __pyx_obj_4bpf4_4core_BpfInterface *);


/* "bpf4/core.pyx":2010
 * 
 * 
 * cdef class BpfBase(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef ndarray xs, ys
 *     cdef DTYPE_t* xs_data
 */

struct __pyx_vtabstruct_4bpf4_4core_BpfBase {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
  void (*_invalidate_cache)(struct __pyx_obj_4bpf4_4core_BpfBase *);
  PyArrayObject *(*_mapn_between)(struct __pyx_obj_4bpf4_4core_BpfBase *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7BpfBase__mapn_between *__pyx_optional_args);
  void (*_recalculate_bounds)(struct __pyx_obj_4bpf4_4core_BpfBase *);
};
static struct __pyx_vtabstruct_4bpf4_4core_BpfBase *__pyx_vtabptr_4bpf4_4core_BpfBase;


/* "bpf4/core.pyx":2361
 * 
 * 
 * cdef class Linear(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with linear interpolation
 */

struct __pyx_vtabstruct_4bpf4_4core_Linear {
  struct __pyx_vtabstruct_4bpf4_4core_BpfBase __pyx_base;
  struct __pyx_obj_4bpf4_4core_Linear *(*sliced)(struct __pyx_obj_4bpf4_4core_Linear *, double, double, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_4bpf4_4core_Linear *__pyx_vtabptr_4bpf4_4core_Linear;


/* "bpf4/core.pyx":2474
 * 
 * 
 * cdef class Smooth(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with smoothstep interpolation.
 */

struct __pyx_vtabstruct_4bpf4_4core_Smooth {
  struct __pyx_vtabstruct_4bpf4_4core_BpfBase __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_Smooth *__pyx_vtabptr_4bpf4_4core_Smooth;


/* "bpf4/core.pyx":2509
 * 
 * 
 * cdef class Smoother(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with smootherstep interpolation (perlin's variation of smoothstep)
 */

struct __pyx_vtabstruct_4bpf4_4core_Smoother {
  struct __pyx_vtabstruct_4bpf4_4core_BpfBase __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_Smoother *__pyx_vtabptr_4bpf4_4core_Smoother;


/* "bpf4/core.pyx":2529
 * 
 * 
 * cdef class Halfcos(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with half-cosine interpolation
 */

struct __pyx_vtabstruct_4bpf4_4core_Halfcos {
  struct __pyx_vtabstruct_4bpf4_4core_BpfBase __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_Halfcos *__pyx_vtabptr_4bpf4_4core_Halfcos;


/* "bpf4/core.pyx":2576
 * 
 * 
 * cdef class Halfcosm(Halfcos):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with half-cosine and exponent depending on the orientation of the interpolation
 */

struct __pyx_vtabstruct_4bpf4_4core_Halfcosm {
  struct __pyx_vtabstruct_4bpf4_4core_Halfcos __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_Halfcosm *__pyx_vtabptr_4bpf4_4core_Halfcosm;


/* "bpf4/core.pyx":2599
 * 
 * 
 * cdef class Expon(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with exponential interpolation
 */

struct __pyx_vtabstruct_4bpf4_4core_Expon {
  struct __pyx_vtabstruct_4bpf4_4core_BpfBase __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_Expon *__pyx_vtabptr_4bpf4_4core_Expon;


/* "bpf4/core.pyx":2645
 * 
 * 
 * cdef class Exponm(Expon):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with symmetrical exponential interpolation
 */

struct __pyx_vtabstruct_4bpf4_4core_Exponm {
  struct __pyx_vtabstruct_4bpf4_4core_Expon __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_Exponm *__pyx_vtabptr_4bpf4_4core_Exponm;


/* "bpf4/core.pyx":2680
 * 
 * 
 * cdef class NoInterpol(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf without interpolation
 */

struct __pyx_vtabstruct_4bpf4_4core_NoInterpol {
  struct __pyx_vtabstruct_4bpf4_4core_BpfBase __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_NoInterpol *__pyx_vtabptr_4bpf4_4core_NoInterpol;


/* "bpf4/core.pyx":2707
 * 
 * 
 * cdef class Nearest(BpfBase):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with nearest interpolation
 */

struct __pyx_vtabstruct_4bpf4_4core_Nearest {
  struct __pyx_vtabstruct_4bpf4_4core_BpfBase __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_Nearest *__pyx_vtabptr_4bpf4_4core_Nearest;


/* "bpf4/core.pyx":2839
 * 
 * 
 * cdef class Sampled(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with regularly sampled data
 */

struct __pyx_vtabstruct_4bpf4_4core_Sampled {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_Sampled *(*set_interpolation)(struct __pyx_obj_4bpf4_4core_Sampled *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_4bpf4_4core_Sampled *__pyx_vtabptr_4bpf4_4core_Sampled;


/* "bpf4/core.pyx":3191
 * 
 * 
 * cdef class Spline(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf with cubic spline interpolation
 */

struct __pyx_vtabstruct_4bpf4_4core_Spline {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
  PyObject *(*_points)(struct __pyx_obj_4bpf4_4core_Spline *);
};
static struct __pyx_vtabstruct_4bpf4_4core_Spline *__pyx_vtabptr_4bpf4_4core_Spline;
static CYTHON_INLINE PyObject *__pyx_f_4bpf4_4core_6Spline__points(struct __pyx_obj_4bpf4_4core_Spline *);


/* "bpf4/core.pyx":3295
 * 
 * 
 * cdef class USpline(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     bpf with univariate spline interpolation.
 */

struct __pyx_vtabstruct_4bpf4_4core_USpline {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_USpline *__pyx_vtabptr_4bpf4_4core_USpline;


/* "bpf4/core.pyx":3389
 * 
 * 
 * cdef class _BpfConcat2(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface a
 *     cdef BpfInterface b
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfConcat2 {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfConcat2 *__pyx_vtabptr_4bpf4_4core__BpfConcat2;


/* "bpf4/core.pyx":3408
 * 
 * 
 * cdef class Slope(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing a linear equation `y = slope * x + offset`
 */

struct __pyx_vtabstruct_4bpf4_4core_Slope {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_Slope *(*_slice)(struct __pyx_obj_4bpf4_4core_Slope *, double, double, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_4bpf4_4core_Slope *__pyx_vtabptr_4bpf4_4core_Slope;


/* "bpf4/core.pyx":3512
 * 
 * 
 * cdef class _BpfCompose(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing function composition `f(x) = b(a(x))`
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfCompose {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfCompose *__pyx_vtabptr_4bpf4_4core__BpfCompose;


/* "bpf4/core.pyx":3576
 * 
 * 
 * cdef class _BpfConcat(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing the concatenation of multiple bpfs
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfConcat {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core_BpfInterface *(*concat)(struct __pyx_obj_4bpf4_4core__BpfConcat *, struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_10_BpfConcat_concat *__pyx_optional_args);
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfConcat *__pyx_vtabptr_4bpf4_4core__BpfConcat;


/* "bpf4/core.pyx":3656
 * 
 * 
 * cdef class _BpfBlend(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface a, b
 *     cdef BpfInterface which
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfBlend {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfBlend *__pyx_vtabptr_4bpf4_4core__BpfBlend;


/* "bpf4/core.pyx":3686
 * 
 * 
 * cdef class _BpfBlendConst(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface a, b
 *     cdef double which
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfBlendConst {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfBlendConst *__pyx_vtabptr_4bpf4_4core__BpfBlendConst;


/* "bpf4/core.pyx":3710
 * 
 * 
 * cdef class Multi(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf where each segment can have its own interpolation kind
 */

struct __pyx_vtabstruct_4bpf4_4core_Multi {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_Multi *__pyx_vtabptr_4bpf4_4core_Multi;


/* "bpf4/core.pyx":3824
 * 
 * 
 * cdef class _FunctionWrap_Object(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef object f
 * 
 */

struct __pyx_vtabstruct_4bpf4_4core__FunctionWrap_Object {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__FunctionWrap_Object *__pyx_vtabptr_4bpf4_4core__FunctionWrap_Object;


/* "bpf4/core.pyx":3909
 * 
 * 
 * cdef class _FunctionWrap_Object_OutboundConst(_FunctionWrap_Object):             # <<<<<<<<<<<<<<
 *     cdef double y0, y1
 *     cdef double __ccall__(self, double x) nogil:
 */

struct __pyx_vtabstruct_4bpf4_4core__FunctionWrap_Object_OutboundConst {
  struct __pyx_vtabstruct_4bpf4_4core__FunctionWrap_Object __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__FunctionWrap_Object_OutboundConst *__pyx_vtabptr_4bpf4_4core__FunctionWrap_Object_OutboundConst;


/* "bpf4/core.pyx":3928
 * 
 * 
 * cdef class Const(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing a constant value
 */

struct __pyx_vtabstruct_4bpf4_4core_Const {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_Const *__pyx_vtabptr_4bpf4_4core_Const;


/* "bpf4/core.pyx":4019
 *     return out
 * 
 * cdef class _BpfBinOp(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing a binary operation between two bpfs
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
  void (*_apply)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int);
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp *__pyx_vtabptr_4bpf4_4core__BpfBinOp;


/* "bpf4/core.pyx":4081
 * 
 * 
 * cdef class _BpfUnaryFunc(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface a
 *     cdef t_unfunc func
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryFunc {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
  void (*_apply)(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *, __pyx_t_4bpf4_4core_DTYPE_t *, int);
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryFunc *__pyx_vtabptr_4bpf4_4core__BpfUnaryFunc;


/* "bpf4/core.pyx":4146
 * 
 * 
 * cdef class _BpfUnaryOp(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing a unary operation on a bpf
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
  void (*_apply)(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *, __pyx_t_4bpf4_4core_DTYPE_t *, int);
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp *__pyx_vtabptr_4bpf4_4core__BpfUnaryOp;


/* "bpf4/core.pyx":4196
 * 
 * 
 * cdef class _BpfBinOpConst(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing a binary operation between a bpf and a constant value
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
  void (*_apply)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double);
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;


/* "bpf4/core.pyx":4255
 * 
 * 
 * cdef class _BpfLambdaAdd(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaAdd {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaAdd *__pyx_vtabptr_4bpf4_4core__BpfLambdaAdd;


/* "bpf4/core.pyx":4264
 * 
 * 
 * cdef class _BpfLambdaAddConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaAddConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaAddConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaAddConst;


/* "bpf4/core.pyx":4288
 * 
 * 
 * cdef class _BpfLambdaSub(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaSub {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaSub *__pyx_vtabptr_4bpf4_4core__BpfLambdaSub;


/* "bpf4/core.pyx":4296
 * 
 * 
 * cdef class _BpfLambdaRSub(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRSub {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRSub *__pyx_vtabptr_4bpf4_4core__BpfLambdaRSub;


/* "bpf4/core.pyx":4304
 * 
 * 
 * cdef class _BpfLambdaSubConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaSubConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaSubConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaSubConst;


/* "bpf4/core.pyx":4312
 * 
 * 
 * cdef class _BpfLambdaRSubConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRSubConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRSubConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaRSubConst;


/* "bpf4/core.pyx":4320
 * 
 * 
 * cdef class _BpfLambdaMul(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaMul {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaMul *__pyx_vtabptr_4bpf4_4core__BpfLambdaMul;


/* "bpf4/core.pyx":4326
 * 
 * 
 * cdef class _BpfLambdaMulConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaMulConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaMulConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaMulConst;


/* "bpf4/core.pyx":4334
 * 
 * 
 * cdef class _BpfLambdaPow(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaPow {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaPow *__pyx_vtabptr_4bpf4_4core__BpfLambdaPow;


/* "bpf4/core.pyx":4340
 * 
 * 
 * cdef class _BpfLambdaPowConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaPowConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaPowConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaPowConst;


/* "bpf4/core.pyx":4346
 * 
 * 
 * cdef class _BpfLambdaRPowConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRPowConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRPowConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaRPowConst;


/* "bpf4/core.pyx":4352
 * 
 * 
 * cdef class _BpfLambdaDiv(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaDiv {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaDiv *__pyx_vtabptr_4bpf4_4core__BpfLambdaDiv;


/* "bpf4/core.pyx":4359
 * 
 * 
 * cdef class _BpfLambdaDivConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaDivConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaDivConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaDivConst;


/* "bpf4/core.pyx":4366
 * 
 * 
 * cdef class _BpfLambdaMod(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaMod {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaMod *__pyx_vtabptr_4bpf4_4core__BpfLambdaMod;


/* "bpf4/core.pyx":4373
 * 
 * 
 * cdef class _BpfLambdaModConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaModConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaModConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaModConst;


/* "bpf4/core.pyx":4380
 * 
 * 
 * cdef class _BpfLambdaRDiv(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRDiv {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRDiv *__pyx_vtabptr_4bpf4_4core__BpfLambdaRDiv;


/* "bpf4/core.pyx":4387
 * 
 * 
 * cdef class _BpfLambdaRDivConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRDivConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRDivConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaRDivConst;


/* "bpf4/core.pyx":4394
 * 
 * 
 * cdef class _BpfLambdaGreaterThan(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaGreaterThan {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaGreaterThan *__pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterThan;


/* "bpf4/core.pyx":4400
 * 
 * 
 * cdef class _BpfLambdaGreaterOrEqualThan(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaGreaterOrEqualThan {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaGreaterOrEqualThan *__pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterOrEqualThan;


/* "bpf4/core.pyx":4406
 * 
 * 
 * cdef class _BpfLambdaGreaterThanConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaGreaterThanConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaGreaterThanConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterThanConst;


/* "bpf4/core.pyx":4412
 * 
 * 
 * cdef class _BpfLambdaGreaterOrEqualThanConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst;


/* "bpf4/core.pyx":4418
 * 
 * 
 * cdef class _BpfLambdaLowerThan(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLowerThan {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLowerThan *__pyx_vtabptr_4bpf4_4core__BpfLambdaLowerThan;


/* "bpf4/core.pyx":4424
 * 
 * 
 * cdef class _BpfLambdaLowerThanConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLowerThanConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLowerThanConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaLowerThanConst;


/* "bpf4/core.pyx":4430
 * 
 * 
 * cdef class _BpfLambdaLowerOrEqualThan(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLowerOrEqualThan {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLowerOrEqualThan *__pyx_vtabptr_4bpf4_4core__BpfLambdaLowerOrEqualThan;


/* "bpf4/core.pyx":4436
 * 
 * 
 * cdef class _BpfLambdaLowerOrEqualThanConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLowerOrEqualThanConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLowerOrEqualThanConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaLowerOrEqualThanConst;


/* "bpf4/core.pyx":4442
 * 
 * 
 * cdef class _BpfLambdaEqual(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaEqual {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaEqual *__pyx_vtabptr_4bpf4_4core__BpfLambdaEqual;


/* "bpf4/core.pyx":4448
 * 
 * 
 * cdef class _BpfLambdaEqualConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaEqualConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaEqualConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaEqualConst;


/* "bpf4/core.pyx":4454
 * 
 * 
 * cdef class _BpfLambdaUnequal(_BpfBinOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaUnequal {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaUnequal *__pyx_vtabptr_4bpf4_4core__BpfLambdaUnequal;


/* "bpf4/core.pyx":4460
 * 
 * 
 * cdef class _BpfLambdaUnequalConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaUnequalConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaUnequalConst *__pyx_vtabptr_4bpf4_4core__BpfLambdaUnequalConst;


/* "bpf4/core.pyx":4466
 * 
 * 
 * cdef class _BpfMaxConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         cdef double y
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfMaxConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfMaxConst *__pyx_vtabptr_4bpf4_4core__BpfMaxConst;


/* "bpf4/core.pyx":4474
 * 
 * 
 * cdef class _BpfMinConst(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         cdef double y
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfMinConst {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfMinConst *__pyx_vtabptr_4bpf4_4core__BpfMinConst;


/* "bpf4/core.pyx":4482
 * 
 * 
 * cdef class _BpfLambdaLog(_BpfBinOpConst):             # <<<<<<<<<<<<<<
 *     def __init__(_BpfBinOpConst self, BpfInterface a, double b, tuple bounds, str op=''):
 *         _BpfBinOpConst.__init__(self, a, b, bounds, op)
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLog {
  struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLog *__pyx_vtabptr_4bpf4_4core__BpfLambdaLog;


/* "bpf4/core.pyx":4493
 * 
 * 
 * cdef class _BpfLambdaRound(_BpfUnaryOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRound {
  struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRound *__pyx_vtabptr_4bpf4_4core__BpfLambdaRound;


/* "bpf4/core.pyx":4499
 * 
 * 
 * cdef class _BpfRand(_BpfUnaryOp):             # <<<<<<<<<<<<<<
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfRand {
  struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfRand *__pyx_vtabptr_4bpf4_4core__BpfRand;


/* "bpf4/core.pyx":4506
 * 
 * 
 * cdef class _BpfM2F(_BpfUnaryOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfM2F {
  struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfM2F *__pyx_vtabptr_4bpf4_4core__BpfM2F;


/* "bpf4/core.pyx":4512
 * 
 * 
 * cdef class _BpfF2M(_BpfUnaryOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfF2M {
  struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfF2M *__pyx_vtabptr_4bpf4_4core__BpfF2M;


/* "bpf4/core.pyx":4518
 * 
 * 
 * cdef class _Bpf_db2amp(_BpfUnaryOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 */

struct __pyx_vtabstruct_4bpf4_4core__Bpf_db2amp {
  struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__Bpf_db2amp *__pyx_vtabptr_4bpf4_4core__Bpf_db2amp;


/* "bpf4/core.pyx":4524
 * 
 * 
 * cdef class _Bpf_amp2db(_BpfUnaryOp):             # <<<<<<<<<<<<<<
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         cdef double x
 */

struct __pyx_vtabstruct_4bpf4_4core__Bpf_amp2db {
  struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__Bpf_amp2db *__pyx_vtabptr_4bpf4_4core__Bpf_amp2db;


/* "bpf4/core.pyx":4532
 * 
 * 
 * cdef class _BpfLambdaClip(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface bpf
 *     cdef double y0, y1
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaClip {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaClip *__pyx_vtabptr_4bpf4_4core__BpfLambdaClip;


/* "bpf4/core.pyx":4595
 * 
 * 
 * cdef class _BpfDeriv(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing the derivative of another bpf
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfDeriv {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfDeriv *__pyx_vtabptr_4bpf4_4core__BpfDeriv;


/* "bpf4/core.pyx":4634
 * 
 * 
 * cdef class _BpfInverted(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface bpf
 *     cdef double bpf_x0, bpf_x1
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfInverted {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfInverted *__pyx_vtabptr_4bpf4_4core__BpfInverted;


/* "bpf4/core.pyx":4663
 * 
 * 
 * cdef class _BpfIntegrate(BpfInterface):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf representing the integration of another bpf
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfIntegrate {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
  int (*get_integration_steps)(struct __pyx_obj_4bpf4_4core__BpfIntegrate *, double);
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfIntegrate *__pyx_vtabptr_4bpf4_4core__BpfIntegrate;


/* "bpf4/core.pyx":4748
 * 
 * 
 * cdef class _BpfPeriodic(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface bpf
 *     cdef double x0
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfPeriodic {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfPeriodic *__pyx_vtabptr_4bpf4_4core__BpfPeriodic;


/* "bpf4/core.pyx":4772
 * 
 * 
 * cdef class _BpfProjection(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface bpf
 *     cdef double bpf_x0
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfProjection {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfProjection *__pyx_vtabptr_4bpf4_4core__BpfProjection;


/* "bpf4/core.pyx":4830
 * 
 * 
 * cdef class _BpfKeepSlope(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface bpf
 *     cdef double EPSILON
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfKeepSlope {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfKeepSlope *__pyx_vtabptr_4bpf4_4core__BpfKeepSlope;


/* "bpf4/core.pyx":4857
 * 
 * 
 * cdef class _BpfCrop(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface bpf
 *     cdef readonly double _y0, _y1
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfCrop {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
  struct __pyx_obj_4bpf4_4core__BpfCrop *(*outbound_set)(struct __pyx_obj_4bpf4_4core__BpfCrop *, double, double, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfCrop *__pyx_vtabptr_4bpf4_4core__BpfCrop;


/* "bpf4/core.pyx":4994
 * 
 * 
 * cdef class _MultipleBpfs(BpfInterface):             # <<<<<<<<<<<<<<
 *     cdef tuple _bpfs
 *     cdef void** bpfpointers
 */

struct __pyx_vtabstruct_4bpf4_4core__MultipleBpfs {
  struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__MultipleBpfs *__pyx_vtabptr_4bpf4_4core__MultipleBpfs;


/* "bpf4/core.pyx":5030
 * 
 * 
 * cdef class Max(_MultipleBpfs):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf which returns the max of multiple bpfs at a given point
 */

struct __pyx_vtabstruct_4bpf4_4core_Max {
  struct __pyx_vtabstruct_4bpf4_4core__MultipleBpfs __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_Max *__pyx_vtabptr_4bpf4_4core_Max;


/* "bpf4/core.pyx":5061
 * 
 * 
 * cdef class Min(_MultipleBpfs):             # <<<<<<<<<<<<<<
 *     """
 *     A bpf which returns the min of multiple bpfs at a given point
 */

struct __pyx_vtabstruct_4bpf4_4core_Min {
  struct __pyx_vtabstruct_4bpf4_4core__MultipleBpfs __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core_Min *__pyx_vtabptr_4bpf4_4core_Min;


/* "bpf4/core.pyx":5093
 * 
 * 
 * cdef class _BpfSelect(_MultipleBpfs):             # <<<<<<<<<<<<<<
 *     cdef BpfInterface which
 *     cdef InterpolFunc* func
 */

struct __pyx_vtabstruct_4bpf4_4core__BpfSelect {
  struct __pyx_vtabstruct_4bpf4_4core__MultipleBpfs __pyx_base;
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfSelect *__pyx_vtabptr_4bpf4_4core__BpfSelect;


/* "View.MemoryView":330
 * 
 * @cname('__pyx_memoryview')
 * cdef class memoryview(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef object obj
 */

struct __pyx_vtabstruct_memoryview {
  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
};
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;


/* "View.MemoryView":965
 * 
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
 *     "Internal class for passing memoryview slices to Python"
 * 
 */

struct __pyx_vtabstruct__memoryviewslice {
  struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* PyUnicodeContains.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) {
    int result = PyUnicode_Contains(text, substring);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* pyobject_as_double.proto */
static double __Pyx__PyObject_AsDouble(PyObject* obj);
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj)\
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
 likely(PyInt_CheckExact(obj)) ?\
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj)\
((likely(PyFloat_CheckExact(obj))) ?\
 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

/* IncludeStringH.proto */
#include <string.h>

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);

/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT   1
#define __Pyx_MEMVIEW_PTR      2
#define __Pyx_MEMVIEW_FULL     4
#define __Pyx_MEMVIEW_CONTIG   8
#define __Pyx_MEMVIEW_STRIDED  16
#define __Pyx_MEMVIEW_FOLLOW   32
#define __Pyx_IS_C_CONTIG 1
#define __Pyx_IS_F_CONTIG 2
static int __Pyx_init_memviewslice(
                struct __pyx_memoryview_obj *memview,
                int ndim,
                __Pyx_memviewslice *memviewslice,
                int memview_is_new_reference);
static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
    __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
    __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* CallableCheck.proto */
#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3
#define __Pyx_PyCallable_Check(obj)   (Py_TYPE(obj)->tp_call != NULL)
#else
#define __Pyx_PyCallable_Check(obj)   PyCallable_Check(obj)
#endif

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

/* UnpackTuple2.proto */
#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
    (likely(is_tuple || PyTuple_Check(tuple)) ?\
        (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
            __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
            (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
        __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);

/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);

/* MergeKeywords.proto */
static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyIntFromDouble.proto */
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value);
#else
#define __Pyx_PyInt_FromDouble(value) PyLong_FromDouble(value)
#endif

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* KeywordStringCheck.proto */
static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

/* None.proto */
static CYTHON_INLINE long __Pyx_mod_long(long, long);

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

/* IsLittleEndian.proto */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);

/* BufferFormatCheck.proto */
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type);

/* BufferGetAndValidate.proto */
#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
    ((obj == Py_None || obj == NULL) ?\
    (__Pyx_ZeroBuffer(buf), 0) :\
    __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
    __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static void __Pyx_ZeroBuffer(Py_buffer* buf);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif PY_MAJOR_VERSION < 3
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_str(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_str(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

/* GCCDiagnostics.proto */
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* BuildPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char);

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);

#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck);

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* BufferFallbackError.proto */
static void __Pyx_RaiseBufferFallbackError(void);

/* SliceTupleAndList.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
#else
#define __Pyx_PyList_GetSlice(seq, start, stop)   PySequence_GetSlice(seq, start, stop)
#define __Pyx_PyTuple_GetSlice(seq, start, stop)  PySequence_GetSlice(seq, start, stop)
#endif

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* None.proto */
static CYTHON_INLINE double __Pyx_mod_double(double, double);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    size_t defaults_size;  // used by FusedFunction for copying defaults
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

/* None.proto */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);

/* UnaryNegOverflows.proto */
#define UNARY_NEG_WOULD_OVERFLOW(x)\
        (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
/* decode_c_string_utf16.proto */
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 0;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = -1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}

/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject* none = _PyList_Extend((PyListObject*)L, v);
    if (unlikely(!none))
        return -1;
    Py_DECREF(none);
    return 0;
#else
    return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
#endif
}

/* None.proto */
static CYTHON_INLINE long __Pyx_div_long(long, long);

/* CallNextTpTraverse.proto */
static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);

/* CallNextTpClear.proto */
static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* ClassMethod.proto */
#include "descrobject.h"
static CYTHON_UNUSED PyObject* __Pyx_Method_ClassMethod(PyObject *method);

/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

#if PY_MAJOR_VERSION < 3
    static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
    static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
    #define __Pyx_GetBuffer PyObject_GetBuffer
    #define __Pyx_ReleaseBuffer PyBuffer_Release
#endif


/* BufferStructDeclare.proto */
typedef struct {
  Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
  size_t refcount;
  Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
  __Pyx_Buffer *rcbuffer;
  char *data;
  __Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;

/* MemviewSliceIsContig.proto */
static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);

/* OverlappingSlices.proto */
static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
                                __Pyx_memviewslice *slice2,
                                int ndim, size_t itemsize);

/* Capsule.proto */
static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);

/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);

/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
                int *axes_specs,
                int c_or_f_flag,
                int buf_flags,
                int ndim,
                __Pyx_TypeInfo *dtype,
                __Pyx_BufFmt_StackElem stack[],
                __Pyx_memviewslice *memviewslice,
                PyObject *original_obj);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *, int writable_flag);

/* MemviewDtypeToObject.proto */
static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);

/* RealImag.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX\
        && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq_float(a, b)   ((a)==(b))
    #define __Pyx_c_sum_float(a, b)  ((a)+(b))
    #define __Pyx_c_diff_float(a, b) ((a)-(b))
    #define __Pyx_c_prod_float(a, b) ((a)*(b))
    #define __Pyx_c_quot_float(a, b) ((a)/(b))
    #define __Pyx_c_neg_float(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
    #define __Pyx_c_conj_float(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (::std::abs(z))
        #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_float(z) ((z)==0)
    #define __Pyx_c_conj_float(z)    (conjf(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (cabsf(z))
        #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq_double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_double(a, b) ((a)-(b))
    #define __Pyx_c_prod_double(a, b) ((a)*(b))
    #define __Pyx_c_quot_double(a, b) ((a)/(b))
    #define __Pyx_c_neg_double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
    #define __Pyx_c_conj_double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (::std::abs(z))
        #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_double(z) ((z)==0)
    #define __Pyx_c_conj_double(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (cabs(z))
        #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

/* MemviewSliceCopyTemplate.proto */
static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
                                 const char *mode, int ndim,
                                 size_t sizeof_dtype, int contig_flag,
                                 int dtype_is_object);

/* CIntFromPy.proto */
static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Generator.proto */
#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface__asbpf(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_4bpf4_4core_12BpfInterface__bounds_changed(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto*/
static CYTHON_INLINE void __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1); /* proto*/
static CYTHON_INLINE void __pyx_f_4bpf4_4core_12BpfInterface__set_bounds_like(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a); /* proto*/
static double __pyx_f_4bpf4_4core_12BpfInterface_ntodx(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_v_N, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_4bpf4_4core_12BpfInterface_dxton(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_dx, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_sampled(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_dx, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled *__pyx_optional_args); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_12BpfInterface_sample_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, double __pyx_v_dx, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sample_between *__pyx_optional_args); /* proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_sampled_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, double __pyx_v_dx, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled_between *__pyx_optional_args); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_12BpfInterface_mapn_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_12BpfInterface_map(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map *__pyx_optional_args); /* proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_concat(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfLambdaRound *__pyx_f_4bpf4_4core_12BpfInterface_round(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfRand *__pyx_f_4bpf4_4core_12BpfInterface_rand(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_cos(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_sin(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_ceil(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_expon(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_floor(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_tanh(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_abs(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_sqrt(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_acos(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_asin(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_tan(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_sinh(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_log10(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfLambdaLog *__pyx_f_4bpf4_4core_12BpfInterface_log(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_log *__pyx_optional_args); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfM2F *__pyx_f_4bpf4_4core_12BpfInterface_m2f(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfF2M *__pyx_f_4bpf4_4core_12BpfInterface_f2m(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__Bpf_db2amp *__pyx_f_4bpf4_4core_12BpfInterface_db2amp(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__Bpf_amp2db *__pyx_f_4bpf4_4core_12BpfInterface_amp2db(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_f_4bpf4_4core_12BpfInterface_clip(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_clip *__pyx_optional_args); /* proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_derivative(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_integrated(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static double __pyx_f_4bpf4_4core_12BpfInterface_integrate(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static double __pyx_f_4bpf4_4core_12BpfInterface_trapz_integrate_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_trapz_integrate_between *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_12BpfInterface_integrate_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_12BpfInterface_mean(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_4bpf4_4core_12BpfInterface_zeros(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_zeros *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_12BpfInterface___ccall__(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, CYTHON_UNUSED double __pyx_v_other); /* proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_fit_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_shifted(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_dx, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface__slice(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_4bpf4_4core_7BpfBase__bounds_changed(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self); /* proto*/
static void __pyx_f_4bpf4_4core_7BpfBase__invalidate_cache(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self); /* proto*/
static double __pyx_f_4bpf4_4core_7BpfBase___ccall__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, double __pyx_v_x); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_7BpfBase_mapn_between(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, int __pyx_v_n, double __pyx_v_xstart, double __pyx_v_xend, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7BpfBase_mapn_between *__pyx_optional_args); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_7BpfBase__mapn_between(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, int __pyx_v_n, double __pyx_v_xstart, double __pyx_v_xend, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7BpfBase__mapn_between *__pyx_optional_args); /* proto*/
static void __pyx_f_4bpf4_4core_7BpfBase__recalculate_bounds(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self); /* proto*/
static double __pyx_f_4bpf4_4core_6Linear_integrate_between(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_6Linear_integrate_between *__pyx_optional_args); /* proto*/
static struct __pyx_obj_4bpf4_4core_Linear *__pyx_f_4bpf4_4core_6Linear_sliced(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_4bpf4_4core_Sampled *__pyx_f_4bpf4_4core_7Sampled_set_interpolation(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, PyObject *__pyx_v_interpolation, int __pyx_skip_dispatch); /* proto*/
static double __pyx_f_4bpf4_4core_7Sampled___ccall__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, double __pyx_v_x); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_7Sampled_mapn_between(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7Sampled_mapn_between *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_7Sampled_integrate(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static double __pyx_f_4bpf4_4core_7Sampled_integrate_between(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7Sampled_integrate_between *__pyx_optional_args); /* proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_7Sampled_derivative(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static double __pyx_f_4bpf4_4core_6Spline___ccall__(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self, double __pyx_v_x); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_4bpf4_4core_6Spline__points(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self); /* proto*/
static double __pyx_f_4bpf4_4core_7USpline___ccall__(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, double __pyx_v_x); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_7USpline_map(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7USpline_map *__pyx_optional_args); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_7USpline_mapn_between(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7USpline_mapn_between *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_11_BpfConcat2___ccall__(struct __pyx_obj_4bpf4_4core__BpfConcat2 *__pyx_v_self, double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_5Slope___ccall__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, double __pyx_v_x); /* proto*/
struct __pyx_obj_4bpf4_4core_Slope *__pyx_f_4bpf4_4core_5Slope__slice(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch); /* proto*/
struct __pyx_obj_4bpf4_4core_Slope *__pyx_f_4bpf4_4core_5Slope__slice__pyx_wrap_1(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_5Slope_mapn_between(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_5Slope_mapn_between *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_11_BpfCompose___ccall__(struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_v_self, double __pyx_v_x); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_11_BpfCompose_mapn_between(struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_11_BpfCompose_mapn_between *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_10_BpfConcat___ccall__(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self, double __pyx_v_x); /* proto*/
struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_10_BpfConcat_concat(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_10_BpfConcat_concat *__pyx_optional_args); /* proto*/
struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_10_BpfConcat_concat__pyx_wrap_1(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static double __pyx_f_4bpf4_4core_9_BpfBlend___ccall__(struct __pyx_obj_4bpf4_4core__BpfBlend *__pyx_v_self, double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_14_BpfBlendConst___ccall__(struct __pyx_obj_4bpf4_4core__BpfBlendConst *__pyx_v_self, double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_5Multi___ccall__(struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self, double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_20_FunctionWrap_Object___ccall__(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, double __pyx_v_x); /* proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_20_FunctionWrap_Object__slice(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_20_FunctionWrap_Object_map(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_20_FunctionWrap_Object_map *__pyx_optional_args); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_20_FunctionWrap_Object_mapn_between(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_20_FunctionWrap_Object_mapn_between *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_34_FunctionWrap_Object_OutboundConst___ccall__(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object_OutboundConst *__pyx_v_self, double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_5Const___ccall__(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, CYTHON_UNUSED double __pyx_v_x); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_5Const_mapn_between(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, int __pyx_v_n, CYTHON_UNUSED double __pyx_v_x0, CYTHON_UNUSED double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_5Const_mapn_between *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_9_BpfBinOp___ccall__(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, double __pyx_v_x); /* proto*/
static void __pyx_f_4bpf4_4core_9_BpfBinOp__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, CYTHON_UNUSED __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, CYTHON_UNUSED __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, CYTHON_UNUSED int __pyx_v_n); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_9_BpfBinOp_mapn_between(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_9_BpfBinOp_mapn_between *__pyx_optional_args); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_9_BpfBinOp_map(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_9_BpfBinOp_map *__pyx_optional_args); /* proto*/
static void __pyx_f_4bpf4_4core_13_BpfUnaryFunc__apply(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n); /* proto*/
static double __pyx_f_4bpf4_4core_13_BpfUnaryFunc___ccall__(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, double __pyx_v_x); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_13_BpfUnaryFunc_mapn_between(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_13_BpfUnaryFunc_mapn_between *__pyx_optional_args); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_13_BpfUnaryFunc_map(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_13_BpfUnaryFunc_map *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_11_BpfUnaryOp___ccall__(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, double __pyx_v_x); /* proto*/
static void __pyx_f_4bpf4_4core_11_BpfUnaryOp__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, CYTHON_UNUSED __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, CYTHON_UNUSED int __pyx_v_n); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_11_BpfUnaryOp_mapn_between(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_11_BpfUnaryOp_mapn_between *__pyx_optional_args); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_11_BpfUnaryOp_map(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_11_BpfUnaryOp_map *__pyx_optional_args); /* proto*/
static void __pyx_f_4bpf4_4core_14_BpfBinOpConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self, CYTHON_UNUSED __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, CYTHON_UNUSED int __pyx_v_n, CYTHON_UNUSED double __pyx_v_x); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_14_BpfBinOpConst_map(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_14_BpfBinOpConst_map *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_14_BpfBinOpConst___ccall__(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self, double __pyx_v_x); /* proto*/
static void __pyx_f_4bpf4_4core_13_BpfLambdaAdd__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaAdd *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static double __pyx_f_4bpf4_4core_13_BpfLambdaAdd_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaAdd *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_13_BpfLambdaAdd_integrate_between *__pyx_optional_args); /* proto*/
static void __pyx_f_4bpf4_4core_18_BpfLambdaAddConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaAddConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static double __pyx_f_4bpf4_4core_18_BpfLambdaAddConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaAddConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_18_BpfLambdaAddConst_integrate_between *__pyx_optional_args); /* proto*/
static void __pyx_f_4bpf4_4core_13_BpfLambdaSub__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaSub *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static double __pyx_f_4bpf4_4core_13_BpfLambdaSub_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaSub *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_13_BpfLambdaSub_integrate_between *__pyx_optional_args); /* proto*/
static void __pyx_f_4bpf4_4core_14_BpfLambdaRSub__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaRSub *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static double __pyx_f_4bpf4_4core_14_BpfLambdaRSub_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaRSub *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_14_BpfLambdaRSub_integrate_between *__pyx_optional_args); /* proto*/
static void __pyx_f_4bpf4_4core_18_BpfLambdaSubConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaSubConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static double __pyx_f_4bpf4_4core_18_BpfLambdaSubConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaSubConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_18_BpfLambdaSubConst_integrate_between *__pyx_optional_args); /* proto*/
static void __pyx_f_4bpf4_4core_19_BpfLambdaRSubConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaRSubConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static double __pyx_f_4bpf4_4core_19_BpfLambdaRSubConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaRSubConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_19_BpfLambdaRSubConst_integrate_between *__pyx_optional_args); /* proto*/
static void __pyx_f_4bpf4_4core_13_BpfLambdaMul__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaMul *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_18_BpfLambdaMulConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaMulConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static double __pyx_f_4bpf4_4core_18_BpfLambdaMulConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaMulConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_18_BpfLambdaMulConst_integrate_between *__pyx_optional_args); /* proto*/
static void __pyx_f_4bpf4_4core_13_BpfLambdaPow__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaPow *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_18_BpfLambdaPowConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaPowConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_19_BpfLambdaRPowConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaRPowConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_13_BpfLambdaDiv__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaDiv *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_18_BpfLambdaDivConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaDivConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_13_BpfLambdaMod__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaMod *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_18_BpfLambdaModConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaModConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_14_BpfLambdaRDiv__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaRDiv *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_19_BpfLambdaRDivConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaRDivConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_21_BpfLambdaGreaterThan__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThan *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_28_BpfLambdaGreaterOrEqualThan__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThan *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_26_BpfLambdaGreaterThanConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThanConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_33_BpfLambdaGreaterOrEqualThanConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_19_BpfLambdaLowerThan__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThan *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_24_BpfLambdaLowerThanConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThanConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_26_BpfLambdaLowerOrEqualThan__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThan *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_31_BpfLambdaLowerOrEqualThanConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThanConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_15_BpfLambdaEqual__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaEqual *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_20_BpfLambdaEqualConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaEqualConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_17_BpfLambdaUnequal__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaUnequal *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_22_BpfLambdaUnequalConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaUnequalConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_12_BpfMaxConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfMaxConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_12_BpfMinConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfMinConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_13_BpfLambdaLog__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaLog *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b); /* proto*/
static void __pyx_f_4bpf4_4core_15_BpfLambdaRound__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaRound *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_8_BpfRand__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfRand *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_7_BpfM2F__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfM2F *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_7_BpfF2M__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfF2M *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_11_Bpf_db2amp__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__Bpf_db2amp *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n); /* proto*/
static void __pyx_f_4bpf4_4core_11_Bpf_amp2db__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__Bpf_amp2db *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n); /* proto*/
static double __pyx_f_4bpf4_4core_14_BpfLambdaClip___ccall__(struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_v_self, double __pyx_v_x); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_14_BpfLambdaClip_mapn_between(struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_14_BpfLambdaClip_mapn_between *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_9_BpfDeriv___ccall__(struct __pyx_obj_4bpf4_4core__BpfDeriv *__pyx_v_self, double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_12_BpfInverted___ccall__(struct __pyx_obj_4bpf4_4core__BpfInverted *__pyx_v_self, double __pyx_v_x); /* proto*/
static int __pyx_f_4bpf4_4core_13_BpfIntegrate_get_integration_steps(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_13_BpfIntegrate___ccall__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, double __pyx_v_x); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_13_BpfIntegrate_mapn_between(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_13_BpfIntegrate_mapn_between *__pyx_optional_args); /* proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_13_BpfIntegrate_derivative(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static double __pyx_f_4bpf4_4core_12_BpfPeriodic___ccall__(struct __pyx_obj_4bpf4_4core__BpfPeriodic *__pyx_v_self, double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_14_BpfProjection___ccall__(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self, double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_13_BpfKeepSlope___ccall__(struct __pyx_obj_4bpf4_4core__BpfKeepSlope *__pyx_v_self, double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_8_BpfCrop___ccall__(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, double __pyx_v_x); /* proto*/
static struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_f_4bpf4_4core_8_BpfCrop_outbound_set(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, double __pyx_v_y0, double __pyx_v_y1, int __pyx_skip_dispatch); /* proto*/
static double __pyx_f_4bpf4_4core_8_BpfCrop_integrate_between(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_8_BpfCrop_integrate_between *__pyx_optional_args); /* proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_8_BpfCrop_mapn_between(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_8_BpfCrop_mapn_between *__pyx_optional_args); /* proto*/
static double __pyx_f_4bpf4_4core_13_MultipleBpfs___ccall__(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__MultipleBpfs *__pyx_v_self, CYTHON_UNUSED double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_3Max___ccall__(struct __pyx_obj_4bpf4_4core_Max *__pyx_v_self, double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_3Min___ccall__(struct __pyx_obj_4bpf4_4core_Min *__pyx_v_self, double __pyx_v_x); /* proto*/
static double __pyx_f_4bpf4_4core_10_BpfSelect___ccall__(struct __pyx_obj_4bpf4_4core__BpfSelect *__pyx_v_self, double __pyx_v_x); /* proto*/
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/

/* Module declarations from 'libc.string' */

/* Module declarations from 'libc.stdlib' */

/* Module declarations from 'libc.stdio' */

/* Module declarations from 'libc.stdint' */

/* Module declarations from 'cpython.version' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

/* Module declarations from 'cpython.object' */

/* Module declarations from 'cpython.ref' */

/* Module declarations from 'cpython.exc' */

/* Module declarations from 'cpython.module' */

/* Module declarations from 'cpython.mem' */

/* Module declarations from 'cpython.tuple' */

/* Module declarations from 'cpython.list' */

/* Module declarations from 'cpython.sequence' */

/* Module declarations from 'cpython.mapping' */

/* Module declarations from 'cpython.iterator' */

/* Module declarations from 'cpython.number' */

/* Module declarations from 'cpython.int' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.bool' */
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;

/* Module declarations from 'cpython.long' */

/* Module declarations from 'cpython.float' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.complex' */
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;

/* Module declarations from 'cpython.string' */

/* Module declarations from 'cpython.unicode' */

/* Module declarations from 'cpython.dict' */

/* Module declarations from 'cpython.instance' */

/* Module declarations from 'cpython.function' */

/* Module declarations from 'cpython.method' */

/* Module declarations from 'cpython.weakref' */

/* Module declarations from 'cpython.getargs' */

/* Module declarations from 'cpython.pythread' */

/* Module declarations from 'cpython.pystate' */

/* Module declarations from 'cpython.cobject' */

/* Module declarations from 'cpython.oldbuffer' */

/* Module declarations from 'cpython.set' */

/* Module declarations from 'cpython.buffer' */

/* Module declarations from 'cpython.bytes' */

/* Module declarations from 'cpython.pycapsule' */

/* Module declarations from 'cpython' */

/* Module declarations from 'cython.view' */

/* Module declarations from 'cython' */

/* Module declarations from 'numpy' */

/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
static PyTypeObject *__pyx_ptype_5numpy_number = 0;
static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
static PyTypeObject *__pyx_ptype_5numpy_character = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/

/* Module declarations from 'bpf4.core' */
static PyTypeObject *__pyx_ptype_4bpf4_4core_BpfInterface = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_BpfBase = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Linear = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Smooth = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Smoother = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Halfcos = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Halfcosm = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Expon = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Exponm = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_NoInterpol = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Nearest = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Sampled = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Spline = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_USpline = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfConcat2 = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Slope = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfCompose = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfConcat = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfBlend = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfBlendConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Multi = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__FunctionWrap_Object = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__FunctionWrap_Object_OutboundConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Const = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfBinOp = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfUnaryFunc = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfUnaryOp = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfBinOpConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaAdd = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaAddConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaSub = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaRSub = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaSubConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaRSubConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaMul = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaMulConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaPow = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaPowConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaRPowConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaDiv = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaDivConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaMod = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaModConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaRDiv = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaRDivConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaGreaterThan = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaGreaterOrEqualThan = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaGreaterThanConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaLowerThan = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaLowerThanConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaLowerOrEqualThan = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaLowerOrEqualThanConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaEqual = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaEqualConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaUnequal = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaUnequalConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfMaxConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfMinConst = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaLog = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaRound = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfRand = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfM2F = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfF2M = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__Bpf_db2amp = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__Bpf_amp2db = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfLambdaClip = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfDeriv = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfInverted = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfIntegrate = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfPeriodic = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfProjection = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfKeepSlope = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfCrop = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__MultipleBpfs = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Max = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core_Min = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core__BpfSelect = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core___pyx_scope_struct__segments = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core___pyx_scope_struct_1_segments = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core___pyx_scope_struct_2_segments = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core___pyx_scope_struct_3_segments = 0;
static PyTypeObject *__pyx_ptype_4bpf4_4core___pyx_scope_struct_4_segments = 0;
static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py = 0;
static PyTypeObject *__pyx_array_type = 0;
static PyTypeObject *__pyx_MemviewEnum_type = 0;
static PyTypeObject *__pyx_memoryview_type = 0;
static PyTypeObject *__pyx_memoryviewslice_type = 0;
static double __pyx_v_4bpf4_4core_EPS;
static double __pyx_v_4bpf4_4core_SQRT_EPS;
static double __pyx_v_4bpf4_4core__a4;
static __pyx_t_4bpf4_4core_t_unfunc __pyx_v_4bpf4_4core_UNFUNCS[14];
static __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_4bpf4_4core_InterpolFunc_linear;
static __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_4bpf4_4core_InterpolFunc_halfcos;
static __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_4bpf4_4core_InterpolFunc_nointerpol;
static __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_4bpf4_4core_InterpolFunc_nearest;
static __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_4bpf4_4core_InterpolFunc_smooth;
static __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_4bpf4_4core_InterpolFunc_smoother;
static double __pyx_v_4bpf4_4core_MAX_FLOAT;
static PyObject *generic = 0;
static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
static int __pyx_memoryview_thread_locks_used;
static PyThread_type_lock __pyx_memoryview_thread_locks[8];
static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_linear(__pyx_t_4bpf4_4core_InterpolFunc *, double, double, double, double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_nointerpol(__pyx_t_4bpf4_4core_InterpolFunc *, double, double, double, double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_nearest(__pyx_t_4bpf4_4core_InterpolFunc *, double, double, double, double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_halfcos(__pyx_t_4bpf4_4core_InterpolFunc *, double, double, double, double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_halfcosexp(__pyx_t_4bpf4_4core_InterpolFunc *, double, double, double, double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_halfcosexpm(__pyx_t_4bpf4_4core_InterpolFunc *, double, double, double, double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_expon(__pyx_t_4bpf4_4core_InterpolFunc *, double, double, double, double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_exponm(__pyx_t_4bpf4_4core_InterpolFunc *, double, double, double, double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_smooth(__pyx_t_4bpf4_4core_InterpolFunc *, double, double, double, double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_smoother(__pyx_t_4bpf4_4core_InterpolFunc *, double, double, double, double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core__integr_trapz(double *, int, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core__integr_trapz_between_exact(double *, int, double, double, double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core__clip(double, double, double); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core__ntodx(size_t, double, double); /*proto*/
static CYTHON_INLINE size_t __pyx_f_4bpf4_4core__dxton(double, double, double); /*proto*/
static double __pyx_f_4bpf4_4core_m2f(double); /*proto*/
static double __pyx_f_4bpf4_4core_f2m(double); /*proto*/
static CYTHON_INLINE void __pyx_f_4bpf4_4core_InterpolFunc_init(__pyx_t_4bpf4_4core_InterpolFunc *, __pyx_t_4bpf4_4core_t_func, double, char *, unsigned int); /*proto*/
static CYTHON_INLINE __pyx_t_4bpf4_4core_InterpolFunc *__pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_t_4bpf4_4core_t_func, double, char *, unsigned int); /*proto*/
static __pyx_t_4bpf4_4core_InterpolFunc *__pyx_f_4bpf4_4core_InterpolFunc_new_from_descriptor(PyObject *, struct __pyx_opt_args_4bpf4_4core_InterpolFunc_new_from_descriptor *__pyx_optional_args); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core_InterpolFunc_call(__pyx_t_4bpf4_4core_InterpolFunc *, double, double, double, double, double); /*proto*/
static CYTHON_INLINE void __pyx_f_4bpf4_4core_InterpolFunc_free(__pyx_t_4bpf4_4core_InterpolFunc *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_4bpf4_4core_InterpolFunc_get_descriptor(__pyx_t_4bpf4_4core_InterpolFunc *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_4bpf4_4core_EMPTY1D(int); /*proto*/
static int __pyx_f_4bpf4_4core__array_issorted(__Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE int __pyx_f_4bpf4_4core__searchsorted(__Pyx_memviewslice, double); /*proto*/
static CYTHON_INLINE int __pyx_f_4bpf4_4core__csearchlinear(__pyx_t_4bpf4_4core_DTYPE_t *, int, __pyx_t_4bpf4_4core_DTYPE_t, int); /*proto*/
static CYTHON_INLINE int __pyx_f_4bpf4_4core__csearchsorted(__pyx_t_4bpf4_4core_DTYPE_t *, int, __pyx_t_4bpf4_4core_DTYPE_t); /*proto*/
static CYTHON_INLINE int __pyx_f_4bpf4_4core__csearchsorted_left(__pyx_t_4bpf4_4core_DTYPE_t *, int, __pyx_t_4bpf4_4core_DTYPE_t); /*proto*/
static CYTHON_INLINE double *__pyx_f_4bpf4_4core__seq_to_doubles(PyObject *); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core__asbpf(PyObject *); /*proto*/
static __pyx_t_4bpf4_4core_SplineS *__pyx_f_4bpf4_4core_SplineS_new(PyObject *, PyObject *, Py_ssize_t, struct __pyx_opt_args_4bpf4_4core_SplineS_new *__pyx_optional_args); /*proto*/
static void __pyx_f_4bpf4_4core_SplineS_destroy(__pyx_t_4bpf4_4core_SplineS *); /*proto*/
static void __pyx_f_4bpf4_4core_SplineS_calc_ypp(__pyx_t_4bpf4_4core_SplineS *); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core_SplineS_at(__pyx_t_4bpf4_4core_SplineS *, double); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_f_4bpf4_4core__BpfCompose_new(struct __pyx_obj_4bpf4_4core_BpfInterface *, struct __pyx_obj_4bpf4_4core_BpfInterface *); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfConcat2 *__pyx_f_4bpf4_4core__BpfConcat2_new(struct __pyx_obj_4bpf4_4core_BpfInterface *, struct __pyx_obj_4bpf4_4core_BpfInterface *, double); /*proto*/
static struct __pyx_obj_4bpf4_4core__FunctionWrap_Object_OutboundConst *__pyx_f_4bpf4_4core__FunctionWrap_Object_OutboundConst_new(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *, double, double); /*proto*/
static PyObject *__pyx_f_4bpf4_4core__create_lambda_unordered(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_4bpf4_4core__create_lambda(struct __pyx_obj_4bpf4_4core_BpfInterface *, PyObject *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_4bpf4_4core__create_rlambda(PyObject *, PyObject *, PyObject *, PyObject *, struct __pyx_opt_args_4bpf4_4core__create_rlambda *__pyx_optional_args); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core__BpfUnaryFunc_new(struct __pyx_obj_4bpf4_4core_BpfInterface *, __pyx_t_4bpf4_4core_t_unfunc, int); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(struct __pyx_obj_4bpf4_4core_BpfInterface *, int); /*proto*/
static __pyx_t_4bpf4_4core_t_unfunc __pyx_f_4bpf4_4core__unfunc_from_index(int); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_f_4bpf4_4core__BpfLambdaClip_new(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double); /*proto*/
static double __pyx_f_4bpf4_4core_m_log(double); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_f_4bpf4_4core__BpfCrop_new(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core__BpfCrop_new *__pyx_optional_args); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_blend(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_blend *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_4bpf4_4core_isnumber(PyObject *); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core__bpf_brentq(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, double, int *, double, double, int, int *); /*proto*/
static PyObject *__pyx_f_4bpf4_4core_bpf_zero_crossings(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_bpf_zero_crossings *__pyx_optional_args); /*proto*/
static CYTHON_INLINE double __pyx_f_4bpf4_4core__integrate_adaptive_simpsons_inner(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, double, double, double, double, double, int); /*proto*/
static double __pyx_f_4bpf4_4core_integrate_simpsons(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, struct __pyx_opt_args_4bpf4_4core_integrate_simpsons *__pyx_optional_args); /*proto*/
static PyObject *__Pyx_CFunc_double____double____nogil_to_py(double (*)(double)); /*proto*/
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
static void *__pyx_align_pointer(void *, size_t); /*proto*/
static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
static PyObject *_unellipsify(PyObject *, int); /*proto*/
static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t = { "DTYPE_t", NULL, sizeof(__pyx_t_4bpf4_4core_DTYPE_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
#define __Pyx_MODULE_NAME "bpf4.core"
extern int __pyx_module_is_main_bpf4__core;
int __pyx_module_is_main_bpf4__core = 0;

/* Implementation of 'bpf4.core' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_round;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_ZeroDivisionError;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_Ellipsis;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_IndexError;
static const char __pyx_k_[] = "(";
static const char __pyx_k_N[] = "N";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_a[] = "a";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_h[] = "h";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_y[] = "y";
static const char __pyx_k__2[] = ")";
static const char __pyx_k__6[] = "";
static const char __pyx_k_dx[] = "dx";
static const char __pyx_k_fx[] = "fx";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_op[] = "op";
static const char __pyx_k_p0[] = "p0";
static const char __pyx_k_p1[] = "p1";
static const char __pyx_k_rx[] = "rx";
static const char __pyx_k_x0[] = "x0";
static const char __pyx_k_x1[] = "x1";
static const char __pyx_k_xa[] = "xa";
static const char __pyx_k_xb[] = "xb";
static const char __pyx_k_xs[] = "xs";
static const char __pyx_k_y0[] = "y0";
static const char __pyx_k_y1[] = "y1";
static const char __pyx_k_ys[] = "ys";
static const char __pyx_k_Max[] = "Max";
static const char __pyx_k_Min[] = "Min";
static const char __pyx_k__21[] = "[";
static const char __pyx_k__22[] = ":";
static const char __pyx_k__23[] = "]";
static const char __pyx_k_abs[] = "abs";
static const char __pyx_k_add[] = "__add__";
static const char __pyx_k_bpf[] = "bpf";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_cos[] = "cos";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_exp[] = "exp";
static const char __pyx_k_f2m[] = "f2m";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_kws[] = "kws";
static const char __pyx_k_log[] = "log";
static const char __pyx_k_m2f[] = "m2f";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_min[] = "min";
static const char __pyx_k_mix[] = "mix";
static const char __pyx_k_mul[] = "__mul__";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_out[] = "out";
static const char __pyx_k_qrx[] = "qrx";
static const char __pyx_k_res[] = "res";
static const char __pyx_k_sin[] = "sin";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_tan[] = "tan";
static const char __pyx_k_Nexp[] = "Nexp";
static const char __pyx_k_acos[] = "acos";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_asin[] = "asin";
static const char __pyx_k_axes[] = "axes";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_bpfs[] = "bpfs";
static const char __pyx_k_call[] = "__call__";
static const char __pyx_k_ceil[] = "ceil";
static const char __pyx_k_clip[] = "clip";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_freq[] = "freq";
static const char __pyx_k_func[] = "func";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_kind[] = "kind";
static const char __pyx_k_line[] = "line";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mean[] = "mean";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_ndim[] = "ndim";
static const char __pyx_k_ones[] = "ones";
static const char __pyx_k_pack[] = "pack";
static const char __pyx_k_plot[] = "plot";
static const char __pyx_k_rand[] = "rand";
static const char __pyx_k_rtol[] = "rtol";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_show[] = "show";
static const char __pyx_k_sinh[] = "sinh";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_sqrt[] = "sqrt";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_tanh[] = "tanh";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_wrap[] = "wrap";
static const char __pyx_k_xend[] = "xend";
static const char __pyx_k_xtol[] = "xtol";
static const char __pyx_k_ASCII[] = "ASCII";
static const char __pyx_k_Const[] = "Const";
static const char __pyx_k_DTYPE[] = "DTYPE";
static const char __pyx_k_Expon[] = "Expon";
static const char __pyx_k_Multi[] = "Multi";
static const char __pyx_k_Slope[] = "Slope";
static const char __pyx_k_apply[] = "apply";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_asbpf[] = "_asbpf";
static const char __pyx_k_b_end[] = "b_end";
static const char __pyx_k_blend[] = "blend";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_debug[] = "debug";
static const char __pyx_k_descr[] = "descr";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_dxton[] = "dxton";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_exp_2[] = "] exp=";
static const char __pyx_k_expon[] = "expon";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_float[] = "__float__";
static const char __pyx_k_floor[] = "floor";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_log10[] = "log10";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_newxs[] = "newxs";
static const char __pyx_k_newys[] = "newys";
static const char __pyx_k_ntodx[] = "ntodx";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_round[] = "round";
static const char __pyx_k_setA4[] = "setA4";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_shift[] = "shift";
static const char __pyx_k_slice[] = "_slice";
static const char __pyx_k_slope[] = "slope";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_which[] = "which";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_BpfF2M[] = "_BpfF2M";
static const char __pyx_k_BpfM2F[] = "_BpfM2F";
static const char __pyx_k_CONFIG[] = "CONFIG";
static const char __pyx_k_Exponm[] = "Exponm";
static const char __pyx_k_Linear[] = "Linear";
static const char __pyx_k_Smooth[] = "Smooth";
static const char __pyx_k_Spline[] = "Spline";
static const char __pyx_k_amp2db[] = "amp2db";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_bound0[] = "bound0";
static const char __pyx_k_bound1[] = "bound1";
static const char __pyx_k_bounds[] = "bounds";
static const char __pyx_k_brentq[] = "brentq";
static const char __pyx_k_concat[] = "concat";
static const char __pyx_k_config[] = "config";
static const char __pyx_k_db2amp[] = "db2amp";
static const char __pyx_k_delete[] = "delete";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_insert[] = "insert";
static const char __pyx_k_linear[] = "linear";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_new_xs[] = "new_xs";
static const char __pyx_k_new_ys[] = "new_ys";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_points[] = "points";
static const char __pyx_k_random[] = "random";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_render[] = "render";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_return[] = "return";
static const char __pyx_k_sliced[] = "sliced";
static const char __pyx_k_smooth[] = "smooth";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_unique[] = "unique";
static const char __pyx_k_unpack[] = "unpack";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_xstart[] = "xstart";
static const char __pyx_k_BpfBase[] = "BpfBase";
static const char __pyx_k_BpfCrop[] = "_BpfCrop";
static const char __pyx_k_BpfRand[] = "_BpfRand";
static const char __pyx_k_EPSILON[] = "EPSILON";
static const char __pyx_k_Halfcos[] = "Halfcos";
static const char __pyx_k_Nearest[] = "Nearest";
static const char __pyx_k_Sampled[] = "Sampled";
static const char __pyx_k_USpline[] = "USpline";
static const char __pyx_k_asarray[] = "asarray";
static const char __pyx_k_b_start[] = "b_start";
static const char __pyx_k_bounds0[] = "bounds0";
static const char __pyx_k_bounds1[] = "bounds1";
static const char __pyx_k_epsilon[] = "epsilon";
static const char __pyx_k_expon_3[] = "expon(3)";
static const char __pyx_k_float_2[] = "float";
static const char __pyx_k_fortran[] = "fortran";
static const char __pyx_k_fromseq[] = "fromseq";
static const char __pyx_k_halfcos[] = "halfcos";
static const char __pyx_k_items_2[] = " items";
static const char __pyx_k_memview[] = "memview";
static const char __pyx_k_ndarray[] = "ndarray";
static const char __pyx_k_nearest[] = "nearest";
static const char __pyx_k_numiter[] = "numiter";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_randint[] = "randint";
static const char __pyx_k_sampled[] = "sampled";
static const char __pyx_k_samples[] = "samples";
static const char __pyx_k_shifted[] = "shifted";
static const char __pyx_k_stretch[] = "stretch";
static const char __pyx_k_BpfBinOp[] = "_BpfBinOp";
static const char __pyx_k_BpfBlend[] = "_BpfBlend";
static const char __pyx_k_BpfDeriv[] = "_BpfDeriv";
static const char __pyx_k_Ellipsis[] = "Ellipsis";
static const char __pyx_k_Halfcosm[] = "Halfcosm";
static const char __pyx_k_Smoother[] = "Smoother";
static const char __pyx_k_endpoint[] = "endpoint";
static const char __pyx_k_fadetime[] = "fadetime";
static const char __pyx_k_fixpoint[] = "fixpoint";
static const char __pyx_k_funcalls[] = "funcalls";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_inverted[] = "inverted";
static const char __pyx_k_itemsize[] = "itemsize";
static const char __pyx_k_linspace[] = "linspace";
static const char __pyx_k_max_iter[] = "max_iter";
static const char __pyx_k_maxzeros[] = "maxzeros";
static const char __pyx_k_newstate[] = "newstate";
static const char __pyx_k_outbound[] = "outbound";
static const char __pyx_k_outerror[] = "outerror";
static const char __pyx_k_periodic[] = "periodic";
static const char __pyx_k_preapply[] = "preapply";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_segments[] = "segments";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_BpfConcat[] = "_BpfConcat";
static const char __pyx_k_BpfSelect[] = "_BpfSelect";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_bpf4_core[] = "bpf4.core";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_fadeshape[] = "fadeshape";
static const char __pyx_k_flatpairs[] = "flatpairs";
static const char __pyx_k_funcindex[] = "funcindex";
static const char __pyx_k_integrate[] = "integrate";
static const char __pyx_k_lenpoints[] = "lenpoints";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_outbound0[] = "outbound0";
static const char __pyx_k_outbound1[] = "outbound1";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_stretched[] = "stretched";
static const char __pyx_k_BpfCompose[] = "_BpfCompose";
static const char __pyx_k_BpfConcat2[] = "_BpfConcat2";
static const char __pyx_k_BpfUnaryOp[] = "_BpfUnaryOp";
static const char __pyx_k_Bpf_amp2db[] = "_Bpf_amp2db";
static const char __pyx_k_Bpf_db2amp[] = "_Bpf_db2amp";
static const char __pyx_k_HalfcosExp[] = "HalfcosExp";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_NoInterpol[] = "NoInterpol";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_arrayslice[] = "arrayslice";
static const char __pyx_k_arraytools[] = "arraytools";
static const char __pyx_k_derivative[] = "derivative";
static const char __pyx_k_float_info[] = "float_info";
static const char __pyx_k_get_bounds[] = "_get_bounds";
static const char __pyx_k_halfcosexp[] = "halfcosexp";
static const char __pyx_k_integrated[] = "integrated";
static const char __pyx_k_keep_slope[] = "keep_slope";
static const char __pyx_k_nointerpol[] = "nointerpol";
static const char __pyx_k_oversample[] = "oversample";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_set_bounds[] = "set_bounds";
static const char __pyx_k_BpfCrop_new[] = "_BpfCrop_new";
static const char __pyx_k_BpfInverted[] = "_BpfInverted";
static const char __pyx_k_BpfMaxConst[] = "_BpfMaxConst";
static const char __pyx_k_BpfMinConst[] = "_BpfMinConst";
static const char __pyx_k_BpfPeriodic[] = "_BpfPeriodic";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_USpline_map[] = "USpline.map";
static const char __pyx_k_cfunc_to_py[] = "cfunc.to_py";
static const char __pyx_k_fit_between[] = "fit_between";
static const char __pyx_k_insertpoint[] = "insertpoint";
static const char __pyx_k_min_N_ratio[] = "min_N_ratio";
static const char __pyx_k_plot_coords[] = "plot_coords";
static const char __pyx_k_removepoint[] = "removepoint";
static const char __pyx_k_BpfBinOp_map[] = "_BpfBinOp.map";
static const char __pyx_k_BpfIntegrate[] = "_BpfIntegrate";
static const char __pyx_k_BpfInterface[] = "BpfInterface";
static const char __pyx_k_BpfKeepSlope[] = "_BpfKeepSlope";
static const char __pyx_k_BpfLambdaAdd[] = "_BpfLambdaAdd";
static const char __pyx_k_BpfLambdaDiv[] = "_BpfLambdaDiv";
static const char __pyx_k_BpfLambdaLog[] = "_BpfLambdaLog";
static const char __pyx_k_BpfLambdaMod[] = "_BpfLambdaMod";
static const char __pyx_k_BpfLambdaMul[] = "_BpfLambdaMul";
static const char __pyx_k_BpfLambdaPow[] = "_BpfLambdaPow";
static const char __pyx_k_BpfLambdaSub[] = "_BpfLambdaSub";
static const char __pyx_k_BpfUnaryFunc[] = "_BpfUnaryFunc";
static const char __pyx_k_FunctionWrap[] = "_FunctionWrap";
static const char __pyx_k_MultipleBpfs[] = "_MultipleBpfs";
static const char __pyx_k_Slope__slice[] = "Slope._slice";
static const char __pyx_k_interpoltype[] = "interpoltype";
static const char __pyx_k_mapn_between[] = "mapn_between";
static const char __pyx_k_num_segments[] = "num_segments";
static const char __pyx_k_outbound_set[] = "outbound_set";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_BpfBase_shift[] = "BpfBase.shift";
static const char __pyx_k_BpfBinOpConst[] = "_BpfBinOpConst";
static const char __pyx_k_BpfBlendConst[] = "_BpfBlendConst";
static const char __pyx_k_BpfLambdaClip[] = "_BpfLambdaClip";
static const char __pyx_k_BpfLambdaRDiv[] = "_BpfLambdaRDiv";
static const char __pyx_k_BpfLambdaRSub[] = "_BpfLambdaRSub";
static const char __pyx_k_BpfProjection[] = "_BpfProjection";
static const char __pyx_k_Linear_sliced[] = "Linear.sliced";
static const char __pyx_k_Spline_points[] = "Spline.points";
static const char __pyx_k_bpf4_core_pyx[] = "bpf4/core.pyx";
static const char __pyx_k_interpolation[] = "interpolation";
static const char __pyx_k_outbound_mode[] = "outbound_mode";
static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_BpfBase_points[] = "BpfBase.points";
static const char __pyx_k_BpfLambdaEqual[] = "_BpfLambdaEqual";
static const char __pyx_k_BpfLambdaRound[] = "_BpfLambdaRound";
static const char __pyx_k_BpfPointsError[] = "BpfPointsError";
static const char __pyx_k_BpfUnaryOp_map[] = "_BpfUnaryOp.map";
static const char __pyx_k_Multi_segments[] = "Multi.segments";
static const char __pyx_k_NotImplemented[] = "NotImplemented";
static const char __pyx_k_Sampled_points[] = "Sampled.points";
static const char __pyx_k_array_issorted[] = "_array_issorted";
static const char __pyx_k_interpolations[] = "interpolations";
static const char __pyx_k_mapn_between_2[] = "_mapn_between";
static const char __pyx_k_sample_between[] = "sample_between";
static const char __pyx_k_BpfBase_stretch[] = "BpfBase.stretch";
static const char __pyx_k_Linear_inverted[] = "Linear.inverted";
static const char __pyx_k_Sampled_fromseq[] = "Sampled.fromseq";
static const char __pyx_k_Spline_segments[] = "Spline.segments";
static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
static const char __pyx_k_integrationmode[] = "integrationmode";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_sampled_between[] = "sampled_between";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_BpfBase_outbound[] = "BpfBase.outbound";
static const char __pyx_k_BpfBase_segments[] = "BpfBase.segments";
static const char __pyx_k_BpfConcat_concat[] = "_BpfConcat.concat";
static const char __pyx_k_BpfCrop___reduce[] = "_BpfCrop.__reduce__";
static const char __pyx_k_BpfCrop_outbound[] = "_BpfCrop.outbound";
static const char __pyx_k_BpfInterface_abs[] = "BpfInterface.abs";
static const char __pyx_k_BpfInterface_cos[] = "BpfInterface.cos";
static const char __pyx_k_BpfInterface_f2m[] = "BpfInterface.f2m";
static const char __pyx_k_BpfInterface_log[] = "BpfInterface.log";
static const char __pyx_k_BpfInterface_m2f[] = "BpfInterface.m2f";
static const char __pyx_k_BpfInterface_map[] = "BpfInterface.map";
static const char __pyx_k_BpfInterface_max[] = "BpfInterface.max";
static const char __pyx_k_BpfInterface_min[] = "BpfInterface.min";
static const char __pyx_k_BpfInterface_sin[] = "BpfInterface.sin";
static const char __pyx_k_BpfInterface_tan[] = "BpfInterface.tan";
static const char __pyx_k_BpfLambdaUnequal[] = "_BpfLambdaUnequal";
static const char __pyx_k_BpfUnaryFunc_map[] = "_BpfUnaryFunc.map";
static const char __pyx_k_Const___getstate[] = "Const.__getstate__";
static const char __pyx_k_Expon___getstate[] = "Expon.__getstate__";
static const char __pyx_k_Expon___setstate[] = "Expon.__setstate__";
static const char __pyx_k_Linear_flatpairs[] = "Linear.flatpairs";
static const char __pyx_k_Multi___getstate[] = "Multi.__getstate__";
static const char __pyx_k_Sampled_inverted[] = "Sampled.inverted";
static const char __pyx_k_Sampled_segments[] = "Sampled.segments";
static const char __pyx_k_Slope___getstate[] = "Slope.__getstate__";
static const char __pyx_k_USpline_segments[] = "USpline.segments";
static const char __pyx_k_UnivariateSpline[] = "UnivariateSpline";
static const char __pyx_k_brentq_line_5140[] = "brentq (line 5140)";
static const char __pyx_k_calculate_bounds[] = "_calculate_bounds";
static const char __pyx_k_interlace_arrays[] = "interlace_arrays";
static const char __pyx_k_items_and_ys_has[] = " items and ys has ";
static const char __pyx_k_BpfBinOpConst_map[] = "_BpfBinOpConst.map";
static const char __pyx_k_BpfInterface_acos[] = "BpfInterface.acos";
static const char __pyx_k_BpfInterface_asin[] = "BpfInterface.asin";
static const char __pyx_k_BpfInterface_ceil[] = "BpfInterface.ceil";
static const char __pyx_k_BpfInterface_clip[] = "BpfInterface.clip";
static const char __pyx_k_BpfInterface_copy[] = "BpfInterface.copy";
static const char __pyx_k_BpfInterface_mean[] = "BpfInterface.mean";
static const char __pyx_k_BpfInterface_plot[] = "BpfInterface.plot";
static const char __pyx_k_BpfInterface_rand[] = "BpfInterface.rand";
static const char __pyx_k_BpfInterface_sinh[] = "BpfInterface.sinh";
static const char __pyx_k_BpfInterface_sqrt[] = "BpfInterface.sqrt";
static const char __pyx_k_BpfInterface_tanh[] = "BpfInterface.tanh";
static const char __pyx_k_BpfInversionError[] = "BpfInversionError";
static const char __pyx_k_BpfLambdaAddConst[] = "_BpfLambdaAddConst";
static const char __pyx_k_BpfLambdaDivConst[] = "_BpfLambdaDivConst";
static const char __pyx_k_BpfLambdaModConst[] = "_BpfLambdaModConst";
static const char __pyx_k_BpfLambdaMulConst[] = "_BpfLambdaMulConst";
static const char __pyx_k_BpfLambdaPowConst[] = "_BpfLambdaPowConst";
static const char __pyx_k_BpfLambdaSubConst[] = "_BpfLambdaSubConst";
static const char __pyx_k_Can_t_divide_by_0[] = "Can't divide by 0";
static const char __pyx_k_Sampled_flatpairs[] = "Sampled.flatpairs";
static const char __pyx_k_Sampled_integrate[] = "Sampled.integrate";
static const char __pyx_k_Spline___getstate[] = "Spline.__getstate__";
static const char __pyx_k_ZeroDivisionError[] = "ZeroDivisionError";
static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
static const char __pyx_k_integrate_between[] = "integrate_between";
static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
static const char __pyx_k_scipy_interpolate[] = "scipy.interpolate";
static const char __pyx_k_set_interpolation[] = "set_interpolation";
static const char __pyx_k_BpfBase___getstate[] = "BpfBase.__getstate__";
static const char __pyx_k_BpfBase___setstate[] = "BpfBase.__setstate__";
static const char __pyx_k_BpfCrop___setstate[] = "_BpfCrop.__setstate__";
static const char __pyx_k_BpfInterface_apply[] = "BpfInterface.apply";
static const char __pyx_k_BpfInterface_debug[] = "BpfInterface.debug";
static const char __pyx_k_BpfInterface_dxton[] = "BpfInterface.dxton";
static const char __pyx_k_BpfInterface_expon[] = "BpfInterface.expon";
static const char __pyx_k_BpfInterface_floor[] = "BpfInterface.floor";
static const char __pyx_k_BpfInterface_log10[] = "BpfInterface.log10";
static const char __pyx_k_BpfInterface_ntodx[] = "BpfInterface.ntodx";
static const char __pyx_k_BpfInterface_round[] = "BpfInterface.round";
static const char __pyx_k_BpfInterface_zeros[] = "BpfInterface.zeros";
static const char __pyx_k_BpfLambdaLowerThan[] = "_BpfLambdaLowerThan";
static const char __pyx_k_BpfLambdaRDivConst[] = "_BpfLambdaRDivConst";
static const char __pyx_k_BpfLambdaRPowConst[] = "_BpfLambdaRPowConst";
static const char __pyx_k_BpfLambdaRSubConst[] = "_BpfLambdaRSubConst";
static const char __pyx_k_Const_mapn_between[] = "Const.mapn_between";
static const char __pyx_k_Halfcos___getstate[] = "Halfcos.__getstate__";
static const char __pyx_k_Nearest___getstate[] = "Nearest.__getstate__";
static const char __pyx_k_Sampled___getstate[] = "Sampled.__getstate__";
static const char __pyx_k_Sampled_derivative[] = "Sampled.derivative";
static const char __pyx_k_Slope_mapn_between[] = "Slope.mapn_between";
static const char __pyx_k_bpf_zero_crossings[] = "bpf_zero_crossings";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_crop_outbound_mode[] = "crop.outbound_mode";
static const char __pyx_k_f_is_not_in_points[] = "%f is not in points";
static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
static const char __pyx_k_BpfBase_insertpoint[] = "BpfBase.insertpoint";
static const char __pyx_k_BpfBase_removepoint[] = "BpfBase.removepoint";
static const char __pyx_k_BpfBinOp___getstate[] = "_BpfBinOp.__getstate__";
static const char __pyx_k_BpfBlend___getstate[] = "_BpfBlend.__getstate__";
static const char __pyx_k_BpfDeriv___getstate[] = "_BpfDeriv.__getstate__";
static const char __pyx_k_BpfInterface__asbpf[] = "BpfInterface._asbpf";
static const char __pyx_k_BpfInterface__slice[] = "BpfInterface._slice";
static const char __pyx_k_BpfInterface_amp2db[] = "BpfInterface.amp2db";
static const char __pyx_k_BpfInterface_bounds[] = "BpfInterface.bounds";
static const char __pyx_k_BpfInterface_concat[] = "BpfInterface.concat";
static const char __pyx_k_BpfInterface_db2amp[] = "BpfInterface.db2amp";
static const char __pyx_k_BpfInterface_render[] = "BpfInterface.render";
static const char __pyx_k_BpfLambdaEqualConst[] = "_BpfLambdaEqualConst";
static const char __pyx_k_FunctionWrap_Object[] = "_FunctionWrap_Object";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_clone_with_new_data[] = "clone_with_new_data";
static const char __pyx_k_BpfBase_mapn_between[] = "BpfBase.mapn_between";
static const char __pyx_k_BpfConcat___getstate[] = "_BpfConcat.__getstate__";
static const char __pyx_k_BpfCrop_mapn_between[] = "_BpfCrop.mapn_between";
static const char __pyx_k_BpfCrop_outbound_set[] = "_BpfCrop.outbound_set";
static const char __pyx_k_BpfInterface_fromseq[] = "BpfInterface.fromseq";
static const char __pyx_k_BpfInterface_sampled[] = "BpfInterface.sampled";
static const char __pyx_k_BpfInterface_shifted[] = "BpfInterface.shifted";
static const char __pyx_k_BpfLambdaGreaterThan[] = "_BpfLambdaGreaterThan";
static const char __pyx_k_Sampled_mapn_between[] = "Sampled.mapn_between";
static const char __pyx_k_USpline_mapn_between[] = "USpline.mapn_between";
static const char __pyx_k_could_not_invert_bpf[] = "could not invert bpf";
static const char __pyx_k_get_xs_for_rendering[] = "_get_xs_for_rendering";
static const char __pyx_k_integrate_oversample[] = "integrate.oversample";
static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
static const char __pyx_k_BpfBase__mapn_between[] = "BpfBase._mapn_between";
static const char __pyx_k_BpfBinOp_mapn_between[] = "_BpfBinOp.mapn_between";
static const char __pyx_k_BpfCompose___getstate[] = "_BpfCompose.__getstate__";
static const char __pyx_k_BpfCompose___setstate[] = "_BpfCompose.__setstate__";
static const char __pyx_k_BpfConcat2___getstate[] = "_BpfConcat2.__getstate__";
static const char __pyx_k_BpfConcat2___setstate[] = "_BpfConcat2.__setstate__";
static const char __pyx_k_BpfInterface___reduce[] = "BpfInterface.__reduce__";
static const char __pyx_k_BpfInterface_inverted[] = "BpfInterface.inverted";
static const char __pyx_k_BpfInterface_outbound[] = "BpfInterface.outbound";
static const char __pyx_k_BpfInterface_periodic[] = "BpfInterface.periodic";
static const char __pyx_k_BpfInterface_preapply[] = "BpfInterface.preapply";
static const char __pyx_k_BpfLambdaUnequalConst[] = "_BpfLambdaUnequalConst";
static const char __pyx_k_BpfUnaryFunc___reduce[] = "_BpfUnaryFunc.__reduce__";
static const char __pyx_k_BpfUnaryOp___getstate[] = "_BpfUnaryOp.__getstate__";
static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
static const char __pyx_k_BpfInterface_integrate[] = "BpfInterface.integrate";
static const char __pyx_k_BpfInterface_stretched[] = "BpfInterface.stretched";
static const char __pyx_k_BpfInverted___getstate[] = "_BpfInverted.__getstate__";
static const char __pyx_k_BpfLambdaClip___reduce[] = "_BpfLambdaClip.__reduce__";
static const char __pyx_k_BpfPeriodic___getstate[] = "_BpfPeriodic.__getstate__";
static const char __pyx_k_BpfProjection_fixpoint[] = "_BpfProjection.fixpoint";
static const char __pyx_k_CONST_XS_FOR_RENDERING[] = "CONST_XS_FOR_RENDERING";
static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
static const char __pyx_k_integrate_default_mode[] = "integrate.default_mode";
static const char __pyx_k_BpfCompose_mapn_between[] = "_BpfCompose.mapn_between";
static const char __pyx_k_BpfIntegrate___getstate[] = "_BpfIntegrate.__getstate__";
static const char __pyx_k_BpfIntegrate_derivative[] = "_BpfIntegrate.derivative";
static const char __pyx_k_BpfInterface_derivative[] = "BpfInterface.derivative";
static const char __pyx_k_BpfInterface_integrated[] = "BpfInterface.integrated";
static const char __pyx_k_BpfInterface_keep_slope[] = "BpfInterface.keep_slope";
static const char __pyx_k_BpfKeepSlope___getstate[] = "_BpfKeepSlope.__getstate__";
static const char __pyx_k_BpfLambdaLowerThanConst[] = "_BpfLambdaLowerThanConst";
static const char __pyx_k_BpfUnaryFunc___setstate[] = "_BpfUnaryFunc.__setstate__";
static const char __pyx_k_BpfUnaryOp_mapn_between[] = "_BpfUnaryOp.mapn_between";
static const char __pyx_k_FunctionWrap_Object_map[] = "_FunctionWrap_Object.map";
static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
static const char __pyx_k_MultipleBpfs___getstate[] = "_MultipleBpfs.__getstate__";
static const char __pyx_k_Spline_points_line_3248[] = "Spline.points (line 3248)";
static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
static const char __pyx_k_fade_is_not_implemented[] = "fade is not implemented";
static const char __pyx_k_trapz_integrate_between[] = "trapz_integrate_between";
static const char __pyx_k_BpfBase_points_line_2246[] = "BpfBase.points (line 2246)";
static const char __pyx_k_BpfBinOpConst___getstate[] = "_BpfBinOpConst.__getstate__";
static const char __pyx_k_BpfBlendConst___getstate[] = "_BpfBlendConst.__getstate__";
static const char __pyx_k_BpfInterface_fit_between[] = "BpfInterface.fit_between";
static const char __pyx_k_BpfLambdaClip___setstate[] = "_BpfLambdaClip.__setstate__";
static const char __pyx_k_BpfProjection___getstate[] = "_BpfProjection.__getstate__";
static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
static const char __pyx_k_Linear_integrate_between[] = "Linear.integrate_between";
static const char __pyx_k_Sampled_points_line_2907[] = "Sampled.points (line 2907)";
static const char __pyx_k_get_points_for_rendering[] = "_get_points_for_rendering";
static const char __pyx_k_BpfCrop_integrate_between[] = "_BpfCrop.integrate_between";
static const char __pyx_k_BpfIntegrate_mapn_between[] = "_BpfIntegrate.mapn_between";
static const char __pyx_k_BpfInterface_mapn_between[] = "BpfInterface.mapn_between";
static const char __pyx_k_BpfLambdaGreaterThanConst[] = "_BpfLambdaGreaterThanConst";
static const char __pyx_k_BpfLambdaLowerOrEqualThan[] = "_BpfLambdaLowerOrEqualThan";
static const char __pyx_k_BpfUnaryFunc_mapn_between[] = "_BpfUnaryFunc.mapn_between";
static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
static const char __pyx_k_Sampled_integrate_between[] = "Sampled.integrate_between";
static const char __pyx_k_Sampled_set_interpolation[] = "Sampled.set_interpolation";
static const char __pyx_k_integrate_trapz_intervals[] = "integrate.trapz_intervals";
static const char __pyx_k_BpfInterface_f2m_line_1289[] = "BpfInterface.f2m (line 1289)";
static const char __pyx_k_BpfInterface_m2f_line_1269[] = "BpfInterface.m2f (line 1269)";
static const char __pyx_k_BpfInterface_map_line_1106[] = "BpfInterface.map (line 1106)";
static const char __pyx_k_BpfInterface_max_line_1560[] = "BpfInterface.max (line 1560)";
static const char __pyx_k_BpfInterface_min_line_1588[] = "BpfInterface.min (line 1588)";
static const char __pyx_k_BpfLambdaClip_mapn_between[] = "_BpfLambdaClip.mapn_between";
static const char __pyx_k_FunctionWrap_Object__slice[] = "_FunctionWrap_Object._slice";
static const char __pyx_k_Linear_flatpairs_line_2455[] = "Linear.flatpairs (line 2455)";
static const char __pyx_k_Pyx_CFunc_double____double[] = "__Pyx_CFunc_double____double____nogil_to_py.<locals>.wrap";
static const char __pyx_k_BpfBase_clone_with_new_data[] = "BpfBase.clone_with_new_data";
static const char __pyx_k_BpfInterface_clip_line_1342[] = "BpfInterface.clip (line 1342)";
static const char __pyx_k_BpfInterface_sample_between[] = "BpfInterface.sample_between";
static const char __pyx_k_BpfLambdaGreaterOrEqualThan[] = "_BpfLambdaGreaterOrEqualThan";
static const char __pyx_k_Sampled_flatpairs_line_3175[] = "Sampled.flatpairs (line 3175)";
static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
static const char __pyx_k_BpfInterface_apply_line_1691[] = "BpfInterface.apply (line 1691)";
static const char __pyx_k_BpfInterface_bounds_line_717[] = "BpfInterface.bounds (line 717)";
static const char __pyx_k_BpfInterface_expon_line_1202[] = "BpfInterface.expon (line 1202)";
static const char __pyx_k_BpfInterface_render_line_892[] = "BpfInterface.render (line 892)";
static const char __pyx_k_BpfInterface_sampled_between[] = "BpfInterface.sampled_between";
static const char __pyx_k_BpfInterface_zeros_line_1529[] = "BpfInterface.zeros (line 1529)";
static const char __pyx_k_Sampled_derivative_line_3124[] = "Sampled.derivative (line 3124)";
static const char __pyx_k_BpfInterface_amp2db_line_1324[] = "BpfInterface.amp2db (line 1324)";
static const char __pyx_k_BpfInterface_concat_line_1147[] = "BpfInterface.concat (line 1147)";
static const char __pyx_k_BpfInterface_db2amp_line_1307[] = "BpfInterface.db2amp (line 1307)";
static const char __pyx_k_Can_t_creat_a_BPF_of_0_points[] = "Can't creat a BPF of 0 points";
static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
static const char __pyx_k_BpfBinOp__get_xs_for_rendering[] = "_BpfBinOp._get_xs_for_rendering";
static const char __pyx_k_BpfInterface_integrate_between[] = "BpfInterface.integrate_between";
static const char __pyx_k_BpfInterface_shifted_line_1861[] = "BpfInterface.shifted (line 1861)";
static const char __pyx_k_BpfLambdaAdd_integrate_between[] = "_BpfLambdaAdd.integrate_between";
static const char __pyx_k_BpfLambdaLowerOrEqualThanConst[] = "_BpfLambdaLowerOrEqualThanConst";
static const char __pyx_k_BpfLambdaSub_integrate_between[] = "_BpfLambdaSub.integrate_between";
static const char __pyx_k_FunctionWrap_Object___getstate[] = "_FunctionWrap_Object.__getstate__";
static const char __pyx_k_MultipleBpfs__calculate_bounds[] = "_MultipleBpfs._calculate_bounds";
static const char __pyx_k_Returns_a_bpf_representing_max[] = "\n        Returns a bpf representing `max(self, b)`\n\n        Args:\n            b (float | BpfInterface): a const float or a bpf\n\n        Returns:\n            (Max) A Max bpf representing `max(self, b)`, which can be\n            evaluated at any x coord\n        \n        ## Example\n        \n        ```python\n        >>> from bpf4 import *\n        >>> a = linear(0, 0, 1, 10)\n        >>> b = a.max(4)\n        >>> b(0), b(0.5), b(1)\n        (4.0, 5.0, 10.0)\n        >>> b.plot()\n        ```\n        ![](assets/maxconst.png)\n        ";
static const char __pyx_k_Returns_a_bpf_representing_min[] = "\n        Returns a bpf representing `min(self, b)`\n\n        Args:\n            b (float | BpfInterface): a const float or a bpf\n\n        Returns:\n            (Min) A Min bpf representing `min(self, b)`, which can be\n            evaluated at any x coord\n        \n        ## Example\n        \n        ```python\n        >>> from bpf4 import *\n        >>> a = linear(0, 0, 1, 10)\n        >>> b = a.min(4)\n        >>> b(0), b(0.5), b(1)\n        (0, 4.0, 5.0)\n        >>> b.plot()\n        ```\n        ![](assets/minconst.png)\n        ";
static const char __pyx_k_Returns_a_flat_1D_array_with_x[] = "\n        Returns a flat 1D array with x and y values interlaced\n\n        Returns:\n            (ndarray) A 1D array representing the points of this bpf with *xs* and\n            *ys* interleaved\n\n        ```python\n\n        >>> a = linear(0, 0, 1, 10, 2, 20)\n        >>> a.flatpairs()\n        array([0, 0, 1, 10, 2, 20])\n\n        ```\n        ";
static const char __pyx_k_Sample_this_bpf_at_an_interval[] = "\n        Sample this bpf at an interval of dx between x0 and x1 \n\n        !!! note\n\n            The interface is similar to numpy's `linspace`\n        \n        Args:\n            x0 (float): point to start sampling (included)\n            x1 (float): point to stop sampling (included)\n            dx (float): the sampling period\n            out (ndarray): if given, the result will be placed here and no new array will\n                be allocated\n\n        Returns:\n            (ndarray) An array with the values of this bpf sampled at at a regular grid of \n            period `dx` from `x0` to `x1`. If out is given the result is placed in it\n\n        ## Example\n        \n        ```python\n        \n        >>> a = linear(0, 0, 10, 10)\n        >>> a.sample_between(0, 10, 1)\n        [0 1 2 3 4 5 6 7 8 9 10]\n        ```\n        \n        This is the same as `a.mapn_between(11, 0, 10)`\n        ";
static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
static const char __pyx_k_the_stretch_factor_cannot_be_0[] = "the stretch factor cannot be 0";
static const char __pyx_k_BpfBinOpConst__get_xs_for_rende[] = "_BpfBinOpConst._get_xs_for_rendering";
static const char __pyx_k_BpfInterface_outbound_line_1664[] = "BpfInterface.outbound (line 1664)";
static const char __pyx_k_BpfInterface_periodic_line_1753[] = "BpfInterface.periodic (line 1753)";
static const char __pyx_k_BpfInterface_preapply_line_1723[] = "BpfInterface.preapply (line 1723)";
static const char __pyx_k_BpfLambdaAddConst_integrate_bet[] = "_BpfLambdaAddConst.integrate_between";
static const char __pyx_k_BpfLambdaGreaterOrEqualThanCons[] = "_BpfLambdaGreaterOrEqualThanConst";
static const char __pyx_k_BpfLambdaMulConst_integrate_bet[] = "_BpfLambdaMulConst.integrate_between";
static const char __pyx_k_BpfLambdaRSubConst_integrate_be[] = "_BpfLambdaRSubConst.integrate_between";
static const char __pyx_k_BpfLambdaRSub_integrate_between[] = "_BpfLambdaRSub.integrate_between";
static const char __pyx_k_BpfLambdaSubConst_integrate_bet[] = "_BpfLambdaSubConst.integrate_between";
static const char __pyx_k_BpfUnaryOp__get_xs_for_renderin[] = "_BpfUnaryOp._get_xs_for_rendering";
static const char __pyx_k_Concatenate_this_bpf_to_other_o[] = "\n        Concatenate this bpf to other\n\n        `other` is shifted to start at the end of `self`\n\n        ## Example\n        \n        ```python\n\n        >>> a = linear(0, 0, 1, 10)\n        >>> b = linear(3, 100, 10, 200)\n        >>> c = a.concat(b)\n        >>> c\n        _BpfConcat2[0.0:8.0]\n        >>> c(1 - 1e-12), c(1)\n        (9.99999999999, 100.0)\n        >>> c.plot()\n        ```\n        ![](assets/concat1.png)\n\n        ";
static const char __pyx_k_Const__get_points_for_rendering[] = "Const._get_points_for_rendering";
static const char __pyx_k_Create_a_bpf_where_func_is_appl[] = "\n        Create a bpf where `func` is applied to the result of this pdf\n        \n        Args:\n            func (callable): a function to apply to the result of this bpf\n\n        Returns:\n            (BpfInterface) A bpf representing `func(self(x))` \n\n        **NB**: `a.apply(b)` is the same as `a | b`\n        \n        ## Example\n        \n        ```python\n\n        >>> from bpf4 import *\n        >>> from math import *\n        >>> a = linear(0, 0, 1, 10)\n        >>> def func(x):\n        ...     return sin(x) + 1\n        >>> b = a.apply(func)\n        >>> b(1)\n        0.4559788891106302\n        >>> sin(a(1)) + 1\n        0.4559788891106302\n        \n        ```\n\n        ";
static const char __pyx_k_Create_a_curve_which_represents[] = "\n        Create a curve which represents the derivative of this curve\n\n        Returns:\n            (BpfInterface) A bpf which returns the derivative of this \n            bpf at any given x coord\n\n        It implements Newtons difference quotiont, so that:\n\n        ```\n\n                        bpf(x + h) - bpf(x)\n        derivative(x) = -------------------\n                                  h\n        ```\n\n        Example\n        -------\n\n        ```python\n        \n        >>> from bpf4 import *\n        >>> a = slope(1)[0:6.28].sin()\n        >>> a.plot(show=False, color=\"red\")\n        >>> b = a.derivative()\n        >>> b.plot(color=\"blue\")\n\n        ```\n        ![](assets/derivative1.png)\n        ";
static const char __pyx_k_Create_a_new_bpf_representing_t[] = "\n        Create a new bpf representing this bpf rendered at the given points\n\n        The difference between `.render` and `.sampled` is that this method\n        creates a Linear/NoInterpol bpf whereas `.sampled` returns a \n        `Sampled` bpf (a `Sampled` bpf works only for regularly sampled data,\n        a Linear or NoInterpol bpfs accept any data as its x coordinate)\n\n        Args:\n            xs (int | list | np.ndarray): a seq of points at which this bpf \n                is sampled or a number, in which case an even grid is calculated \n                with that number of points. In the first case a Linear or NoInterpol\n                bpf is returned depending on the `interpolation` parameter (see below).\n                In the second case a `Sampled` bpf is returned.\n            interpolation (str): the interpoltation type of the returned bpf. \n                One of 'linear', 'nointerpol'\n\n        Returns:\n            (BpfInterface) a new bpf representing this bpf. Depending on the interpolation\n            this new bpf will be a Sampled, a Linear or a NoInterpol bpf\n\n        Example\n        -------\n\n        ```python\n\n        >>> from bpf4 import *\n        >>> from math import *\n        >>> a = slope(1)[0:4*pi].sin()\n        >>> b = a.render(20)   # Sample this bpf at 20 points within its bounds\n        >>> b\n        Sampled[0.0:12.566370614359172]\n        >>> b.plot()\n        ```\n        ![](assets/render1.png)\n\n        !!! info \"See Also\"\n\n            [BpfInterface.sampled](#sampled)\n\n        ";
static const char __pyx_k_Create_a_new_bpf_which_replicat[] = "\n        Create a new bpf which replicates this in a periodic way\n\n        Returns:\n            (BpfInterface) A periodic view of this bpf\n\n        The new bpf is a copy of this bpf when inside its bounds \n        and outside it, it replicates it in a periodic way, with no bounds.\n\n        ## Example\n            \n        ```python\n\n        >>> from bpf4 import *\n        >>> a = core.Linear((0, 1), (-1, 1)).periodic()\n        >>> a\n        _BpfPeriodic[-inf:inf]\n        >>> a.plot()\n        ```\n        ![](assets/periodic1.png)\n        ";
static const char __pyx_k_Find_the_zeros_of_this_bpf_Args[] = "\n        Find the zeros of this bpf\n        \n        Args:\n            h: the accuracy to scan for zero-crossings. If two zeros are within \n                this distance, they will be resolved as one.\n            N: alternatively, you can give the number of intervals to scan. \n                h will be derived from this\n            x0: the point to start searching. If not given, the starting point of this bpf\n                will be used\n            x1: the point to stop searching. If not given, the end point of this bpf is used\n            maxzeros: if > 0, stop the search when this number of zeros have been found\n            \n        Returns:\n            (List[float]) A list with the zeros of this bpf\n\n\n        ## Example\n        \n        ```python\n        \n        >>> a = bpf.linear(0, -1, 1, 1)\n        >>> a.zeros()\n        [0.5]\n        \n        ```\n\n        ";
static const char __pyx_k_FunctionWrap_Object_OutboundCon[] = "_FunctionWrap_Object_OutboundConst";
static const char __pyx_k_FunctionWrap_Object_mapn_betwee[] = "_FunctionWrap_Object.mapn_between";
static const char __pyx_k_Points_along_the_x_coord_should[] = "Points along the x coord should be sorted without duplicates.\n xs:\n";
static const char __pyx_k_Return_a_bpf_clipping_the_resul[] = "\n        Return a bpf clipping the result between y0 and y1\n\n        Args:\n            y0 (float): the min. *y* value\n            y1 (float): the max. *y* value\n\n        Returns:\n            (BpfInterface) A view of this bpf clipped to the given\n            *y* values\n\n        ```python\n\n        >>> a = linear(0, -1, 1, 1).clip(0, 1)\n        >>> a.map(20)\n        array([0.        , 0.        , 0.        , 0.        , 0.        ,\n               0.        , 0.        , 0.        , 0.        , 0.        ,\n               0.05263158, 0.15789474, 0.26315789, 0.36842105, 0.47368421,\n               0.57894737, 0.68421053, 0.78947368, 0.89473684, 1.        ])\n        >>> a.plot()\n        ```\n        ![](assets/clip1.png)\n        ";
static const char __pyx_k_Return_a_curve_which_represents[] = "\n        Return a curve which represents the derivative of this curve\n\n        It implements Newtons difference quotiont, so that:\n\n\n            derivative(x) = bpf(x + h) - bpf(x)\n                            -------------------\n                                      h\n        \n        Example\n        -------\n\n        ```python\n        \n        >>> from bpf4 import *\n        >>> a = slope(1)[0:6.28].sin()\n        >>> a.plot(show=False, color=\"red\")\n        >>> b = a.derivative()\n        >>> b.plot(color=\"blue\")\n\n        ```\n        ![](assets/derivative1.png)\n        ";
static const char __pyx_k_Return_a_new_Bpf_with_the_given[] = "\n        Return a new Bpf with the given values outside the bounds\n\n        ## Examples\n        \n        ```python\n\n        >>> from bpf4 import *\n        >>> a = linear(0, 1, 1, 10).outbound(-1, 0)\n        >>> a(-0.5)\n        -1\n        >>> a(1.1)\n        0\n        >>> a(0)\n        1\n        >>> a(1)\n        10\n\n        # fallback to another curve outside self\n        >>> a = linear(0, 1, 1, 10).outbound(0, 0) + expon(-1, 2, 4, 10, exp=2)\n        >>> a.plot()\n        ```\n        ![](assets/outbound1.png)\n        ";
static const char __pyx_k_Return_the_result_of_the_integr[] = "\n        Return the result of the integration of this bpf. \n\n        If any of the bounds is inf, the result is also inf.\n\n        **NB**: to set the bounds of the integration, first crop the bpf via a slice\n        \n        Returns:\n            (float) The result of the integration\n\n        ## Example\n\n        ```python\n\n        >>> linear(0, 0, 10, 10).sin()[0:2*pi].integrate()\n        -1.7099295055304798e-17\n        \n        ```\n        ";
static const char __pyx_k_Returns_a_bpf_converting_decibe[] = "\n        Returns a bpf converting decibels to linear amplitudes\n\n        Returns:\n            (BpfInterface) A bpf representing `\\x -> db2amp(self(x))`\n\n        ## Example\n\n        ```python\n        >>> linear(0, 0, 1, -60).db2amp().map(10)\n        array([1.        , 0.46415888, 0.21544347, 0.1       , 0.04641589,\n               0.02154435, 0.01      , 0.00464159, 0.00215443, 0.001     ])\n        ```\n        ";
static const char __pyx_k_Returns_a_bpf_converting_linear[] = "\n        Returns a bpf converting linear amplitudes to decibels\n\n        Returns:\n            (BpfInterface) A bpf representing `\\x -> amp2db(self(x))`\n\n        ## Example\n\n        ```python\n        >>> linear(0, 0, 1, 1).amp2db().map(10)\n        array([-280.        ,  -19.08485019,  -13.06425028,   -9.54242509,\n               -7.04365036,   -5.1054501 ,   -3.52182518,   -2.18288939,\n               -1.02305045,    0.        ])\n        ```\n        ";
static const char __pyx_k_Returns_a_tuple_with_the_points[] = "\n        Returns a tuple with the points defining this bpf\n\n        Returns:\n            (tuple[ndarray, ndarray]) a tuple (xs, ys) where `xs` is an array\n            holding the values for the *x* coordinate, and `ys` holds the values for\n            the *y* coordinate\n\n        ## Example\n        \n        ```python\n\n        >>> b = Linear.fromseq(0, 0, 1, 100, 2, 50)\n        >>> b.points()\n        ([0, 1, 2], [0, 100, 50])\n        ```\n\n        ";
static const char __pyx_k_Returns_a_tuple_xstart_xend_rep[] = "\n        Returns a tuple (xstart, xend) representing the bounds of this bpf\n\n        Returns:\n            (tuple[float, float]) The bounbs of this bpf\n\n        The returned bounds indicate the range within which this bpf is defined, but\n        any bpf can be evaluated outside those bounds. In such a case the out-of-bound\n        result will depend on the concrete subclass being evaluated. For most cases\n        the out-of-bound result is the same as the result at the bounds\n\n        ## Example\n        \n        ```python\n\n        >>> from bpf4 import *\n        >>> a = linear(1, 10, 2, 25)\n        >>> a.bounds()\n        (1.0, 2.0)\n        ```\n\n        ";
static const char __pyx_k_Returns_a_view_of_this_bpf_fitt[] = "\n        Returns a view of this bpf fitted within the interval `x0:x1`\n\n        This operation only makes sense if the bpf is bounded\n        (none of its bounds is `inf`)\n\n        Args:\n            x0: the lower bound to fit this bpf\n            x1: the upper bound to fit this bpf\n\n        Returns:\n            (BpfInterface) The projected bpf\n\n        ## Example\n        \n        ```python\n\n        >>> from bpf4 import *\n        >>> a = linear(1, 1, 2, 5)\n        >>> a.bounds()\n        (1, 5)\n        >>> b = a.fit_between(0, 10)\n        >>> b.bounds()\n        0, 10\n        >>> b(10)\n        5\n        ```\n        ";
static const char __pyx_k_Returns_a_view_of_this_bpf_shif[] = "\n        Returns a view of this bpf shifted by `dx` over the x-axes\n\n        This is the same as [.shift](#shift), but a new bpf is returned\n\n        ## Example\n        \n        ```python\n\n        >>> from bpf4 import *\n        >>> a = linear(0, 1, 1, 5)\n        >>> b = a.shifted(2)\n        >>> b(3) == a(1)\n        ```\n        ";
static const char __pyx_k_Returns_a_view_of_this_bpf_stre[] = "\n        Returns a view of this bpf stretched over the x axis. \n\n        **NB**: to stretch over the y-axis, just multiply this bpf\n        \n        !!! info \"See Also\"\n\n            [fit_between()](#fit_between)\n\n        Args:\n            rx (float): the stretch factor\n            fixpoint (float): the point to use as reference\n\n        Returns:\n            (BpfInterface) A projection of this bpf stretched/compressed by\n            by the given factor\n\n        ## Example\n\n        Stretch the shape of the bpf, but preserve the start position\n        \n        ```python\n            \n        >>> a = linear(1, 1, 2, 2)\n        >>> b = a.stretched(4, fixpoint=a.x0)\n        >>> b.bounds()\n        (1, 9)\n        >>> a.plot(show=False); b.plot()\n\n        ```\n        ";
static const char __pyx_k_The_instantiation_form_x0_y0_x1[] = "The instantiation form x0, y0, x1, y1 should have an even number of args";
static const char __pyx_k_The_same_as_map_self_xs_but_fas[] = "\n        The same as map(self, xs) but faster\n\n        Args:\n            xs (ndarray | int): the x coordinates at which to sample this bpf,\n                or an integer representing the number of elements to calculate\n                in an evenly spaced grid between the bounds of this bpf\n            out (ndarray): if given, an attempt will be done to use it as destination\n                for the result. The user should not trust that this actually happens\n                (see example)\n\n        ```python\n\n        bpf.map(10) == bpf.map(numpy.linspace(x0, x1, 10))\n        ```\n\n        ## Example\n        \n        ```python\n\n        >>> out = numpy.empty((100,), dtype=float)\n        >>> xs = numpy.linspace(0, 10, 100)\n        # This is the right way to pass an output array\n        >>> out = thisbpf.map(xs, out)   \n        \n        ```\n        ";
static const char __pyx_k_This_bpf_is_unbounded_cannot_be[] = "This bpf is unbounded, cannot be fitted.Use thisbpf[x0:x1].fit_between(...)";
static const char __pyx_k_calculate_the_zero_of_bpf_x0_in[] = "\n    calculate the zero of (bpf + x0) in the interval (xa, xb) using brentq algorithm\n\n    !!! note \n\n        To calculate all the zeros of a bpf, use the [.zeros](#zeros) method\n\n    Args:\n        bpf (BpfInterface): the bpf to evaluate\n        x0 (float): an offset so that bpf(x) + x0 = 0\n        xa (float): the starting point to look for a zero\n        xb (float): the end point\n        xtol (float): The computed root x0 will satisfy np.allclose(x, x0, atol=xtol, rtol=rtol)\n        rtol (float): The computed root x0 will satisfy np.allclose(x, x0, atol=xtol, rtol=rtol)\n        max_iter (int): the max. number of iterations\n\n    Returns:\n        (tuple[float, int]) A tuple (zero of the bpf, number of function calls)\n\n\n    ## Example\n    \n    ```python\n\n    # calculate the x where a == 0.5\n    >>> from bpf4 import *\n    >>> a = linear(0, 0, 10, 1)\n    >>> xzero, numcalls = brentq(a, -0.5, 0, 1)\n    >>> xzero\n    5\n    ```\n    ";
static const char __pyx_k_interpolation_s_not_implemented[] = "interpolation %s not implemented";
static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
static const char __pyx_k_BPFs_accept_only_slices_not_sing[] = "BPFs accept only slices, not single items.";
static const char __pyx_k_BpfInterface__get_points_for_ren[] = "BpfInterface._get_points_for_rendering";
static const char __pyx_k_BpfInterface_derivative_line_136[] = "BpfInterface.derivative (line 1368)";
static const char __pyx_k_BpfInterface_fit_between_line_18[] = "BpfInterface.fit_between (line 1822)";
static const char __pyx_k_BpfInterface_integrate_line_1428[] = "BpfInterface.integrate (line 1428)";
static const char __pyx_k_BpfInterface_sample_between_line[] = "BpfInterface.sample_between (line 1015)";
static const char __pyx_k_BpfInterface_stretched_line_1777[] = "BpfInterface.stretched (line 1777)";
static const char __pyx_k_BpfInterface_trapz_integrate_bet[] = "BpfInterface.trapz_integrate_between";
static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
static const char __pyx_k_Cannot_integrate_a_function_with[] = "Cannot integrate a function with an infinite negative bound";
static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
static const char __pyx_k_Linear__get_points_for_rendering[] = "Linear._get_points_for_rendering";
static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
static const char __pyx_k_Returns_a_bpf_converting_frequen[] = "Returns a bpf converting frequencies to midinotes\n        \n        Returns:\n            (BpfInterface) A bpf representing `\\x -> f2m(self(x))`\n\n        ## Example\n        \n        ```python\n        >>> from bpf4 import *\n        >>> freqs = linear(0, 442, 1, 882)\n        >>> freqs.f2m().map(10)\n        array([69.        , 70.82403712, 72.47407941, 73.98044999, 75.3661766 ,\n               76.64915905, 77.84358713, 78.96089998, 80.01045408, 81.        ])\n        ```\n        ";
static const char __pyx_k_Returns_a_bpf_converting_from_mi[] = "Returns a bpf converting from midinotes to frequency\n\n        Returns:\n            (BpfInterface) A bpf representing `\\x -> m2f(self(x))`\n\n        ## Example\n\n        ```python\n        >>> from bpf4 import *\n        >>> midinotes = linear(0, 60, 1, 65)\n        >>> freqs = midinotes.m2f()\n        >>> freqs.map(10)\n        array([262.81477242, 271.38531671, 280.23535149, 289.37399111,\n               298.81064715, 308.55503809, 318.61719934, 329.0074936 ,\n               339.73662146, 350.81563248])\n        ```\n        ";
static const char __pyx_k_Returns_a_bpf_representing_the_e[] = "Returns a bpf representing the exp operation with this bpf\n\n        ## Example\n\n        ```python\n\n        >>> from bpf4 import *\n        >>> a = linear(0, 0, 1, 10)\n        >>> a(0.1)\n        1.0\n        >>> exp(1.0)\n        2.718281828459045\n        >>> a.expon()(0.1)\n        2.718281828459045\n        ";
static const char __pyx_k_Returns_a_flat_1D_array_with_x_2[] = "\n        Returns a flat 1D array with x and y values interlaced\n\n        Returns:\n            (ndarray) A 1D array with x and y values interlaced\n\n        ```python\n        >>> a = linear(0, 0, 1, 10, 2, 20)\n        >>> a.flatpairs()\n        array([0, 0, 1, 10, 2, 20])\n        ```\n        ";
static const char __pyx_k_Sampled__get_points_for_renderin[] = "Sampled._get_points_for_rendering";
static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
static const char __pyx_k_bpf_can_t_be_inverted_ys_must_al[] = "bpf can't be inverted, ys must always increase.\nys=";
static const char __pyx_k_cannot_integrate_a_function_with[] = "cannot integrate a function with an infinite lower bound";
static const char __pyx_k_could_not_import_scipy_USpline_i[] = "could not import scipy. USpline is a wrapper of UnivariateSpline and cant be used without scipy";
static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
static const char __pyx_k_interpolation_type_not_understoo[] = "interpolation type not understood";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
static const char __pyx_k_xs_and_ys_must_be_of_equal_lengt[] = "xs and ys must be of equal length, but xs has ";
static const char __pyx_k_zero_of_function_cannot_be_found[] = "zero of function cannot be found within the interval given";
static const char __pyx_k_Create_a_bpf_where_func_is_appl_2[] = "\n        Create a bpf where `func` is applied to the argument before it is passed\n\n        This is equivalent to `func(x) | self`\n        \n        Args:\n            func (callable): a function `func(x: float) -> float` which is applied to\n                the argument before passing it to this bpf\n\n        Returns:\n            (BpfInterface) A bpf following the pattern `lambda x: bpf(func(x))`\n\n        ## Example\n        \n        ```python\n\n        >>> bpf = Linear((0, 1, 2), (0, 10, 20))\n        >>> bpf(0.5)\n        5\n\n        >>> shifted_bpf = bpf.preapply(lambda x: x + 1)\n        >>> shifted_bpf(0.5)\n        15\n        ```\n\n        **NB**: `bpf1.preapply(bpf2)` is the same as `bpf2 | bpf1`\n        ";
static const char __pyx_k_Points_along_the_x_coord_should_2[] = "Points along the x coord should be sorted without duplicates. \n";
static const char __pyx_k_Returns_a_tuple_with_the_points_2[] = "\n        Returns a tuple with the points defining this bpf\n\n        Returns:\n            (tuple[ndarray, ndarray]) A tuple `(xs, ys)` where `xs` is an array\n            holding the values for the *x* coordinate, and `ys` holds the values for\n            the *y* coordinate\n\n        ## Example\n        \n        ```python\n\n        >>> b = Linear.fromseq(0, 0, 1, 100, 2, 50)\n        >>> b.points()\n        ([0, 1, 2], [0, 100, 50])\n        ```\n\n        ";
static PyObject *__pyx_kp_u_;
static PyObject *__pyx_n_s_ASCII;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_kp_u_BPFs_accept_only_slices_not_sing;
static PyObject *__pyx_n_s_BpfBase;
static PyObject *__pyx_n_s_BpfBase___getstate;
static PyObject *__pyx_n_s_BpfBase___setstate;
static PyObject *__pyx_n_s_BpfBase__mapn_between;
static PyObject *__pyx_n_s_BpfBase_clone_with_new_data;
static PyObject *__pyx_n_s_BpfBase_insertpoint;
static PyObject *__pyx_n_s_BpfBase_mapn_between;
static PyObject *__pyx_n_s_BpfBase_outbound;
static PyObject *__pyx_n_s_BpfBase_points;
static PyObject *__pyx_kp_u_BpfBase_points_line_2246;
static PyObject *__pyx_n_s_BpfBase_removepoint;
static PyObject *__pyx_n_s_BpfBase_segments;
static PyObject *__pyx_n_s_BpfBase_shift;
static PyObject *__pyx_n_s_BpfBase_stretch;
static PyObject *__pyx_n_s_BpfBinOp;
static PyObject *__pyx_n_s_BpfBinOpConst;
static PyObject *__pyx_n_s_BpfBinOpConst___getstate;
static PyObject *__pyx_n_s_BpfBinOpConst__get_xs_for_rende;
static PyObject *__pyx_n_s_BpfBinOpConst_map;
static PyObject *__pyx_n_s_BpfBinOp___getstate;
static PyObject *__pyx_n_s_BpfBinOp__get_xs_for_rendering;
static PyObject *__pyx_n_s_BpfBinOp_map;
static PyObject *__pyx_n_s_BpfBinOp_mapn_between;
static PyObject *__pyx_n_s_BpfBlend;
static PyObject *__pyx_n_s_BpfBlendConst;
static PyObject *__pyx_n_s_BpfBlendConst___getstate;
static PyObject *__pyx_n_s_BpfBlend___getstate;
static PyObject *__pyx_n_s_BpfCompose;
static PyObject *__pyx_n_s_BpfCompose___getstate;
static PyObject *__pyx_n_s_BpfCompose___setstate;
static PyObject *__pyx_n_s_BpfCompose_mapn_between;
static PyObject *__pyx_n_s_BpfConcat;
static PyObject *__pyx_n_s_BpfConcat2;
static PyObject *__pyx_n_s_BpfConcat2___getstate;
static PyObject *__pyx_n_s_BpfConcat2___setstate;
static PyObject *__pyx_n_s_BpfConcat___getstate;
static PyObject *__pyx_n_s_BpfConcat_concat;
static PyObject *__pyx_n_s_BpfCrop;
static PyObject *__pyx_n_s_BpfCrop___reduce;
static PyObject *__pyx_n_s_BpfCrop___setstate;
static PyObject *__pyx_n_s_BpfCrop_integrate_between;
static PyObject *__pyx_n_s_BpfCrop_mapn_between;
static PyObject *__pyx_n_s_BpfCrop_new;
static PyObject *__pyx_n_s_BpfCrop_outbound;
static PyObject *__pyx_n_s_BpfCrop_outbound_set;
static PyObject *__pyx_n_s_BpfDeriv;
static PyObject *__pyx_n_s_BpfDeriv___getstate;
static PyObject *__pyx_n_s_BpfF2M;
static PyObject *__pyx_n_s_BpfIntegrate;
static PyObject *__pyx_n_s_BpfIntegrate___getstate;
static PyObject *__pyx_n_s_BpfIntegrate_derivative;
static PyObject *__pyx_n_s_BpfIntegrate_mapn_between;
static PyObject *__pyx_n_s_BpfInterface;
static PyObject *__pyx_n_u_BpfInterface;
static PyObject *__pyx_n_s_BpfInterface___reduce;
static PyObject *__pyx_n_s_BpfInterface__asbpf;
static PyObject *__pyx_n_s_BpfInterface__get_points_for_ren;
static PyObject *__pyx_n_s_BpfInterface__slice;
static PyObject *__pyx_n_s_BpfInterface_abs;
static PyObject *__pyx_n_s_BpfInterface_acos;
static PyObject *__pyx_n_s_BpfInterface_amp2db;
static PyObject *__pyx_kp_u_BpfInterface_amp2db_line_1324;
static PyObject *__pyx_n_s_BpfInterface_apply;
static PyObject *__pyx_kp_u_BpfInterface_apply_line_1691;
static PyObject *__pyx_n_s_BpfInterface_asin;
static PyObject *__pyx_n_s_BpfInterface_bounds;
static PyObject *__pyx_kp_u_BpfInterface_bounds_line_717;
static PyObject *__pyx_n_s_BpfInterface_ceil;
static PyObject *__pyx_n_s_BpfInterface_clip;
static PyObject *__pyx_kp_u_BpfInterface_clip_line_1342;
static PyObject *__pyx_n_s_BpfInterface_concat;
static PyObject *__pyx_kp_u_BpfInterface_concat_line_1147;
static PyObject *__pyx_n_s_BpfInterface_copy;
static PyObject *__pyx_n_s_BpfInterface_cos;
static PyObject *__pyx_n_s_BpfInterface_db2amp;
static PyObject *__pyx_kp_u_BpfInterface_db2amp_line_1307;
static PyObject *__pyx_n_s_BpfInterface_debug;
static PyObject *__pyx_n_s_BpfInterface_derivative;
static PyObject *__pyx_kp_u_BpfInterface_derivative_line_136;
static PyObject *__pyx_n_s_BpfInterface_dxton;
static PyObject *__pyx_n_s_BpfInterface_expon;
static PyObject *__pyx_kp_u_BpfInterface_expon_line_1202;
static PyObject *__pyx_n_s_BpfInterface_f2m;
static PyObject *__pyx_kp_u_BpfInterface_f2m_line_1289;
static PyObject *__pyx_n_s_BpfInterface_fit_between;
static PyObject *__pyx_kp_u_BpfInterface_fit_between_line_18;
static PyObject *__pyx_n_s_BpfInterface_floor;
static PyObject *__pyx_n_s_BpfInterface_fromseq;
static PyObject *__pyx_n_s_BpfInterface_integrate;
static PyObject *__pyx_n_s_BpfInterface_integrate_between;
static PyObject *__pyx_kp_u_BpfInterface_integrate_line_1428;
static PyObject *__pyx_n_s_BpfInterface_integrated;
static PyObject *__pyx_n_s_BpfInterface_inverted;
static PyObject *__pyx_n_s_BpfInterface_keep_slope;
static PyObject *__pyx_n_s_BpfInterface_log;
static PyObject *__pyx_n_s_BpfInterface_log10;
static PyObject *__pyx_n_s_BpfInterface_m2f;
static PyObject *__pyx_kp_u_BpfInterface_m2f_line_1269;
static PyObject *__pyx_n_s_BpfInterface_map;
static PyObject *__pyx_kp_u_BpfInterface_map_line_1106;
static PyObject *__pyx_n_s_BpfInterface_mapn_between;
static PyObject *__pyx_n_s_BpfInterface_max;
static PyObject *__pyx_kp_u_BpfInterface_max_line_1560;
static PyObject *__pyx_n_s_BpfInterface_mean;
static PyObject *__pyx_n_s_BpfInterface_min;
static PyObject *__pyx_kp_u_BpfInterface_min_line_1588;
static PyObject *__pyx_n_s_BpfInterface_ntodx;
static PyObject *__pyx_n_s_BpfInterface_outbound;
static PyObject *__pyx_kp_u_BpfInterface_outbound_line_1664;
static PyObject *__pyx_n_s_BpfInterface_periodic;
static PyObject *__pyx_kp_u_BpfInterface_periodic_line_1753;
static PyObject *__pyx_n_s_BpfInterface_plot;
static PyObject *__pyx_n_s_BpfInterface_preapply;
static PyObject *__pyx_kp_u_BpfInterface_preapply_line_1723;
static PyObject *__pyx_n_s_BpfInterface_rand;
static PyObject *__pyx_n_s_BpfInterface_render;
static PyObject *__pyx_kp_u_BpfInterface_render_line_892;
static PyObject *__pyx_n_s_BpfInterface_round;
static PyObject *__pyx_n_s_BpfInterface_sample_between;
static PyObject *__pyx_kp_u_BpfInterface_sample_between_line;
static PyObject *__pyx_n_s_BpfInterface_sampled;
static PyObject *__pyx_n_s_BpfInterface_sampled_between;
static PyObject *__pyx_n_s_BpfInterface_shifted;
static PyObject *__pyx_kp_u_BpfInterface_shifted_line_1861;
static PyObject *__pyx_n_s_BpfInterface_sin;
static PyObject *__pyx_n_s_BpfInterface_sinh;
static PyObject *__pyx_n_s_BpfInterface_sqrt;
static PyObject *__pyx_n_s_BpfInterface_stretched;
static PyObject *__pyx_kp_u_BpfInterface_stretched_line_1777;
static PyObject *__pyx_n_s_BpfInterface_tan;
static PyObject *__pyx_n_s_BpfInterface_tanh;
static PyObject *__pyx_n_s_BpfInterface_trapz_integrate_bet;
static PyObject *__pyx_n_s_BpfInterface_zeros;
static PyObject *__pyx_kp_u_BpfInterface_zeros_line_1529;
static PyObject *__pyx_n_s_BpfInversionError;
static PyObject *__pyx_n_s_BpfInverted;
static PyObject *__pyx_n_s_BpfInverted___getstate;
static PyObject *__pyx_n_s_BpfKeepSlope;
static PyObject *__pyx_n_s_BpfKeepSlope___getstate;
static PyObject *__pyx_n_s_BpfLambdaAdd;
static PyObject *__pyx_n_s_BpfLambdaAddConst;
static PyObject *__pyx_n_s_BpfLambdaAddConst_integrate_bet;
static PyObject *__pyx_n_s_BpfLambdaAdd_integrate_between;
static PyObject *__pyx_n_s_BpfLambdaClip;
static PyObject *__pyx_n_s_BpfLambdaClip___reduce;
static PyObject *__pyx_n_s_BpfLambdaClip___setstate;
static PyObject *__pyx_n_s_BpfLambdaClip_mapn_between;
static PyObject *__pyx_n_s_BpfLambdaDiv;
static PyObject *__pyx_n_s_BpfLambdaDivConst;
static PyObject *__pyx_n_s_BpfLambdaEqual;
static PyObject *__pyx_n_s_BpfLambdaEqualConst;
static PyObject *__pyx_n_s_BpfLambdaGreaterOrEqualThan;
static PyObject *__pyx_n_s_BpfLambdaGreaterOrEqualThanCons;
static PyObject *__pyx_n_s_BpfLambdaGreaterThan;
static PyObject *__pyx_n_s_BpfLambdaGreaterThanConst;
static PyObject *__pyx_n_s_BpfLambdaLog;
static PyObject *__pyx_n_s_BpfLambdaLowerOrEqualThan;
static PyObject *__pyx_n_s_BpfLambdaLowerOrEqualThanConst;
static PyObject *__pyx_n_s_BpfLambdaLowerThan;
static PyObject *__pyx_n_s_BpfLambdaLowerThanConst;
static PyObject *__pyx_n_s_BpfLambdaMod;
static PyObject *__pyx_n_s_BpfLambdaModConst;
static PyObject *__pyx_n_s_BpfLambdaMul;
static PyObject *__pyx_n_s_BpfLambdaMulConst;
static PyObject *__pyx_n_s_BpfLambdaMulConst_integrate_bet;
static PyObject *__pyx_n_s_BpfLambdaPow;
static PyObject *__pyx_n_s_BpfLambdaPowConst;
static PyObject *__pyx_n_s_BpfLambdaRDiv;
static PyObject *__pyx_n_s_BpfLambdaRDivConst;
static PyObject *__pyx_n_s_BpfLambdaRPowConst;
static PyObject *__pyx_n_s_BpfLambdaRSub;
static PyObject *__pyx_n_s_BpfLambdaRSubConst;
static PyObject *__pyx_n_s_BpfLambdaRSubConst_integrate_be;
static PyObject *__pyx_n_s_BpfLambdaRSub_integrate_between;
static PyObject *__pyx_n_s_BpfLambdaRound;
static PyObject *__pyx_n_s_BpfLambdaSub;
static PyObject *__pyx_n_s_BpfLambdaSubConst;
static PyObject *__pyx_n_s_BpfLambdaSubConst_integrate_bet;
static PyObject *__pyx_n_s_BpfLambdaSub_integrate_between;
static PyObject *__pyx_n_s_BpfLambdaUnequal;
static PyObject *__pyx_n_s_BpfLambdaUnequalConst;
static PyObject *__pyx_n_s_BpfM2F;
static PyObject *__pyx_n_s_BpfMaxConst;
static PyObject *__pyx_n_s_BpfMinConst;
static PyObject *__pyx_n_s_BpfPeriodic;
static PyObject *__pyx_n_s_BpfPeriodic___getstate;
static PyObject *__pyx_n_s_BpfPointsError;
static PyObject *__pyx_n_s_BpfProjection;
static PyObject *__pyx_n_s_BpfProjection___getstate;
static PyObject *__pyx_n_s_BpfProjection_fixpoint;
static PyObject *__pyx_n_s_BpfRand;
static PyObject *__pyx_n_s_BpfSelect;
static PyObject *__pyx_n_s_BpfUnaryFunc;
static PyObject *__pyx_n_s_BpfUnaryFunc___reduce;
static PyObject *__pyx_n_s_BpfUnaryFunc___setstate;
static PyObject *__pyx_n_s_BpfUnaryFunc_map;
static PyObject *__pyx_n_s_BpfUnaryFunc_mapn_between;
static PyObject *__pyx_n_s_BpfUnaryOp;
static PyObject *__pyx_n_s_BpfUnaryOp___getstate;
static PyObject *__pyx_n_s_BpfUnaryOp__get_xs_for_renderin;
static PyObject *__pyx_n_s_BpfUnaryOp_map;
static PyObject *__pyx_n_s_BpfUnaryOp_mapn_between;
static PyObject *__pyx_n_s_Bpf_amp2db;
static PyObject *__pyx_n_s_Bpf_db2amp;
static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
static PyObject *__pyx_n_s_CONFIG;
static PyObject *__pyx_n_s_CONST_XS_FOR_RENDERING;
static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
static PyObject *__pyx_kp_u_Can_t_creat_a_BPF_of_0_points;
static PyObject *__pyx_kp_u_Can_t_divide_by_0;
static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
static PyObject *__pyx_kp_u_Cannot_integrate_a_function_with;
static PyObject *__pyx_kp_u_Concatenate_this_bpf_to_other_o;
static PyObject *__pyx_n_s_Const;
static PyObject *__pyx_n_s_Const___getstate;
static PyObject *__pyx_n_s_Const__get_points_for_rendering;
static PyObject *__pyx_n_s_Const_mapn_between;
static PyObject *__pyx_kp_u_Create_a_bpf_where_func_is_appl;
static PyObject *__pyx_kp_u_Create_a_bpf_where_func_is_appl_2;
static PyObject *__pyx_kp_u_Create_a_curve_which_represents;
static PyObject *__pyx_kp_u_Create_a_new_bpf_representing_t;
static PyObject *__pyx_kp_u_Create_a_new_bpf_which_replicat;
static PyObject *__pyx_n_s_DTYPE;
static PyObject *__pyx_n_s_EPSILON;
static PyObject *__pyx_n_s_Ellipsis;
static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
static PyObject *__pyx_n_s_Expon;
static PyObject *__pyx_n_s_Expon___getstate;
static PyObject *__pyx_n_s_Expon___setstate;
static PyObject *__pyx_n_s_Exponm;
static PyObject *__pyx_kp_u_Find_the_zeros_of_this_bpf_Args;
static PyObject *__pyx_n_s_FunctionWrap;
static PyObject *__pyx_n_s_FunctionWrap_Object;
static PyObject *__pyx_n_s_FunctionWrap_Object_OutboundCon;
static PyObject *__pyx_n_s_FunctionWrap_Object___getstate;
static PyObject *__pyx_n_s_FunctionWrap_Object__slice;
static PyObject *__pyx_n_s_FunctionWrap_Object_map;
static PyObject *__pyx_n_s_FunctionWrap_Object_mapn_betwee;
static PyObject *__pyx_n_s_Halfcos;
static PyObject *__pyx_n_s_HalfcosExp;
static PyObject *__pyx_n_s_Halfcos___getstate;
static PyObject *__pyx_n_s_Halfcosm;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
static PyObject *__pyx_n_s_Linear;
static PyObject *__pyx_n_s_Linear__get_points_for_rendering;
static PyObject *__pyx_n_s_Linear_flatpairs;
static PyObject *__pyx_kp_u_Linear_flatpairs_line_2455;
static PyObject *__pyx_n_s_Linear_integrate_between;
static PyObject *__pyx_n_s_Linear_inverted;
static PyObject *__pyx_n_s_Linear_sliced;
static PyObject *__pyx_n_s_Max;
static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
static PyObject *__pyx_kp_s_MemoryView_of_r_object;
static PyObject *__pyx_n_s_Min;
static PyObject *__pyx_n_s_Multi;
static PyObject *__pyx_n_s_Multi___getstate;
static PyObject *__pyx_n_s_Multi_segments;
static PyObject *__pyx_n_s_MultipleBpfs;
static PyObject *__pyx_n_s_MultipleBpfs___getstate;
static PyObject *__pyx_n_s_MultipleBpfs__calculate_bounds;
static PyObject *__pyx_n_s_N;
static PyObject *__pyx_n_s_Nearest;
static PyObject *__pyx_n_s_Nearest___getstate;
static PyObject *__pyx_n_s_Nexp;
static PyObject *__pyx_n_s_NoInterpol;
static PyObject *__pyx_n_s_NotImplemented;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_b_O;
static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_kp_u_Points_along_the_x_coord_should;
static PyObject *__pyx_kp_u_Points_along_the_x_coord_should_2;
static PyObject *__pyx_n_s_Pyx_CFunc_double____double;
static PyObject *__pyx_kp_u_Return_a_bpf_clipping_the_resul;
static PyObject *__pyx_kp_u_Return_a_curve_which_represents;
static PyObject *__pyx_kp_u_Return_a_new_Bpf_with_the_given;
static PyObject *__pyx_kp_u_Return_the_result_of_the_integr;
static PyObject *__pyx_kp_u_Returns_a_bpf_converting_decibe;
static PyObject *__pyx_kp_u_Returns_a_bpf_converting_frequen;
static PyObject *__pyx_kp_u_Returns_a_bpf_converting_from_mi;
static PyObject *__pyx_kp_u_Returns_a_bpf_converting_linear;
static PyObject *__pyx_kp_u_Returns_a_bpf_representing_max;
static PyObject *__pyx_kp_u_Returns_a_bpf_representing_min;
static PyObject *__pyx_kp_u_Returns_a_bpf_representing_the_e;
static PyObject *__pyx_kp_u_Returns_a_flat_1D_array_with_x;
static PyObject *__pyx_kp_u_Returns_a_flat_1D_array_with_x_2;
static PyObject *__pyx_kp_u_Returns_a_tuple_with_the_points;
static PyObject *__pyx_kp_u_Returns_a_tuple_with_the_points_2;
static PyObject *__pyx_kp_u_Returns_a_tuple_xstart_xend_rep;
static PyObject *__pyx_kp_u_Returns_a_view_of_this_bpf_fitt;
static PyObject *__pyx_kp_u_Returns_a_view_of_this_bpf_shif;
static PyObject *__pyx_kp_u_Returns_a_view_of_this_bpf_stre;
static PyObject *__pyx_kp_u_Sample_this_bpf_at_an_interval;
static PyObject *__pyx_n_s_Sampled;
static PyObject *__pyx_n_s_Sampled___getstate;
static PyObject *__pyx_n_s_Sampled__get_points_for_renderin;
static PyObject *__pyx_n_s_Sampled_derivative;
static PyObject *__pyx_kp_u_Sampled_derivative_line_3124;
static PyObject *__pyx_n_s_Sampled_flatpairs;
static PyObject *__pyx_kp_u_Sampled_flatpairs_line_3175;
static PyObject *__pyx_n_s_Sampled_fromseq;
static PyObject *__pyx_n_s_Sampled_integrate;
static PyObject *__pyx_n_s_Sampled_integrate_between;
static PyObject *__pyx_n_s_Sampled_inverted;
static PyObject *__pyx_n_s_Sampled_mapn_between;
static PyObject *__pyx_n_s_Sampled_points;
static PyObject *__pyx_kp_u_Sampled_points_line_2907;
static PyObject *__pyx_n_s_Sampled_segments;
static PyObject *__pyx_n_s_Sampled_set_interpolation;
static PyObject *__pyx_n_s_Slope;
static PyObject *__pyx_n_s_Slope___getstate;
static PyObject *__pyx_n_s_Slope__slice;
static PyObject *__pyx_n_s_Slope_mapn_between;
static PyObject *__pyx_n_s_Smooth;
static PyObject *__pyx_n_s_Smoother;
static PyObject *__pyx_n_s_Spline;
static PyObject *__pyx_n_s_Spline___getstate;
static PyObject *__pyx_n_s_Spline_points;
static PyObject *__pyx_kp_u_Spline_points_line_3248;
static PyObject *__pyx_n_s_Spline_segments;
static PyObject *__pyx_kp_u_The_instantiation_form_x0_y0_x1;
static PyObject *__pyx_kp_u_The_same_as_map_self_xs_but_fas;
static PyObject *__pyx_kp_u_This_bpf_is_unbounded_cannot_be;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_USpline;
static PyObject *__pyx_n_s_USpline_map;
static PyObject *__pyx_n_s_USpline_mapn_between;
static PyObject *__pyx_n_s_USpline_segments;
static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
static PyObject *__pyx_n_s_UnivariateSpline;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_View_MemoryView;
static PyObject *__pyx_n_s_ZeroDivisionError;
static PyObject *__pyx_kp_u__2;
static PyObject *__pyx_kp_u__21;
static PyObject *__pyx_kp_u__22;
static PyObject *__pyx_kp_u__23;
static PyObject *__pyx_n_s__6;
static PyObject *__pyx_kp_u__6;
static PyObject *__pyx_n_s_a;
static PyObject *__pyx_n_s_abs;
static PyObject *__pyx_n_s_acos;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_allocate_buffer;
static PyObject *__pyx_n_s_amp2db;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_apply;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_array_issorted;
static PyObject *__pyx_n_s_arrayslice;
static PyObject *__pyx_n_s_arraytools;
static PyObject *__pyx_n_s_asarray;
static PyObject *__pyx_n_s_asbpf;
static PyObject *__pyx_n_s_ascontiguousarray;
static PyObject *__pyx_n_s_asin;
static PyObject *__pyx_n_s_axes;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_s_b_end;
static PyObject *__pyx_n_s_b_start;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_blend;
static PyObject *__pyx_n_s_bound0;
static PyObject *__pyx_n_s_bound1;
static PyObject *__pyx_n_s_bounds;
static PyObject *__pyx_n_s_bounds0;
static PyObject *__pyx_n_s_bounds1;
static PyObject *__pyx_n_s_bpf;
static PyObject *__pyx_n_s_bpf4_core;
static PyObject *__pyx_kp_s_bpf4_core_pyx;
static PyObject *__pyx_kp_u_bpf_can_t_be_inverted_ys_must_al;
static PyObject *__pyx_n_s_bpf_zero_crossings;
static PyObject *__pyx_n_s_bpfs;
static PyObject *__pyx_n_s_brentq;
static PyObject *__pyx_kp_u_brentq_line_5140;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_u_c;
static PyObject *__pyx_n_s_calculate_bounds;
static PyObject *__pyx_kp_u_calculate_the_zero_of_bpf_x0_in;
static PyObject *__pyx_n_s_call;
static PyObject *__pyx_n_u_call;
static PyObject *__pyx_kp_u_cannot_integrate_a_function_with;
static PyObject *__pyx_n_s_ceil;
static PyObject *__pyx_n_s_cfunc_to_py;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_clip;
static PyObject *__pyx_n_s_clone_with_new_data;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_cls;
static PyObject *__pyx_n_s_concat;
static PyObject *__pyx_n_s_config;
static PyObject *__pyx_kp_s_contiguous_and_direct;
static PyObject *__pyx_kp_s_contiguous_and_indirect;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_cos;
static PyObject *__pyx_kp_u_could_not_import_scipy_USpline_i;
static PyObject *__pyx_kp_u_could_not_invert_bpf;
static PyObject *__pyx_kp_u_crop_outbound_mode;
static PyObject *__pyx_n_u_d;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_db2amp;
static PyObject *__pyx_n_s_debug;
static PyObject *__pyx_n_s_delete;
static PyObject *__pyx_n_s_derivative;
static PyObject *__pyx_n_s_descr;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dtype_is_object;
static PyObject *__pyx_n_s_dx;
static PyObject *__pyx_n_s_dxton;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_endpoint;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_epsilon;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_exp;
static PyObject *__pyx_kp_u_exp_2;
static PyObject *__pyx_n_s_expon;
static PyObject *__pyx_n_u_expon;
static PyObject *__pyx_kp_u_expon_3;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_s_f2m;
static PyObject *__pyx_kp_u_f_is_not_in_points;
static PyObject *__pyx_kp_u_fade_is_not_implemented;
static PyObject *__pyx_n_s_fadeshape;
static PyObject *__pyx_n_s_fadetime;
static PyObject *__pyx_n_s_fit_between;
static PyObject *__pyx_n_s_fixpoint;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_flatpairs;
static PyObject *__pyx_n_u_float;
static PyObject *__pyx_n_s_float_2;
static PyObject *__pyx_n_s_float_info;
static PyObject *__pyx_n_s_floor;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_fortran;
static PyObject *__pyx_n_u_fortran;
static PyObject *__pyx_n_s_freq;
static PyObject *__pyx_n_s_fromseq;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_s_funcalls;
static PyObject *__pyx_n_s_funcindex;
static PyObject *__pyx_n_s_fx;
static PyObject *__pyx_n_s_get_bounds;
static PyObject *__pyx_n_s_get_points_for_rendering;
static PyObject *__pyx_n_s_get_xs_for_rendering;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
static PyObject *__pyx_n_s_h;
static PyObject *__pyx_n_u_halfcos;
static PyObject *__pyx_n_u_halfcosexp;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_insert;
static PyObject *__pyx_n_s_insertpoint;
static PyObject *__pyx_n_s_integrate;
static PyObject *__pyx_n_s_integrate_between;
static PyObject *__pyx_kp_u_integrate_default_mode;
static PyObject *__pyx_kp_u_integrate_oversample;
static PyObject *__pyx_kp_u_integrate_trapz_intervals;
static PyObject *__pyx_n_s_integrated;
static PyObject *__pyx_n_u_integrationmode;
static PyObject *__pyx_n_s_interlace_arrays;
static PyObject *__pyx_n_s_interpolation;
static PyObject *__pyx_kp_u_interpolation_s_not_implemented;
static PyObject *__pyx_kp_u_interpolation_type_not_understoo;
static PyObject *__pyx_n_s_interpolations;
static PyObject *__pyx_n_s_interpoltype;
static PyObject *__pyx_n_s_inverted;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_kp_u_items_2;
static PyObject *__pyx_kp_u_items_and_ys_has;
static PyObject *__pyx_n_s_itemsize;
static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
static PyObject *__pyx_n_s_keep_slope;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kind;
static PyObject *__pyx_n_s_kws;
static PyObject *__pyx_n_s_lenpoints;
static PyObject *__pyx_n_u_line;
static PyObject *__pyx_n_u_linear;
static PyObject *__pyx_n_s_linspace;
static PyObject *__pyx_n_s_log;
static PyObject *__pyx_n_s_log10;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_m2f;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_mapn_between;
static PyObject *__pyx_n_s_mapn_between_2;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_max_iter;
static PyObject *__pyx_n_s_maxzeros;
static PyObject *__pyx_n_s_mean;
static PyObject *__pyx_n_s_memview;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_min;
static PyObject *__pyx_n_s_min_N_ratio;
static PyObject *__pyx_n_s_mix;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_mul;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_u_ndarray;
static PyObject *__pyx_n_s_ndim;
static PyObject *__pyx_n_u_nearest;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_new_xs;
static PyObject *__pyx_n_s_new_ys;
static PyObject *__pyx_n_s_newstate;
static PyObject *__pyx_n_s_newxs;
static PyObject *__pyx_n_s_newys;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_u_nointerpol;
static PyObject *__pyx_n_s_ntodx;
static PyObject *__pyx_n_s_num_segments;
static PyObject *__pyx_n_s_numiter;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_ones;
static PyObject *__pyx_n_s_op;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_out;
static PyObject *__pyx_n_s_outbound;
static PyObject *__pyx_n_s_outbound0;
static PyObject *__pyx_n_s_outbound1;
static PyObject *__pyx_n_s_outbound_mode;
static PyObject *__pyx_n_s_outbound_set;
static PyObject *__pyx_n_s_outerror;
static PyObject *__pyx_n_s_oversample;
static PyObject *__pyx_n_s_p0;
static PyObject *__pyx_n_s_p1;
static PyObject *__pyx_n_s_pack;
static PyObject *__pyx_n_s_periodic;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_plot;
static PyObject *__pyx_n_s_plot_coords;
static PyObject *__pyx_n_s_points;
static PyObject *__pyx_n_s_preapply;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_getbuffer;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_Enum;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qrx;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_rand;
static PyObject *__pyx_n_s_randint;
static PyObject *__pyx_n_s_random;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_removepoint;
static PyObject *__pyx_n_s_render;
static PyObject *__pyx_n_s_res;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_return;
static PyObject *__pyx_n_s_round;
static PyObject *__pyx_n_s_rtol;
static PyObject *__pyx_n_s_rx;
static PyObject *__pyx_n_s_sample_between;
static PyObject *__pyx_n_s_sampled;
static PyObject *__pyx_n_s_sampled_between;
static PyObject *__pyx_n_s_samples;
static PyObject *__pyx_n_s_scipy_interpolate;
static PyObject *__pyx_n_s_segments;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_setA4;
static PyObject *__pyx_n_s_set_bounds;
static PyObject *__pyx_n_s_set_interpolation;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_shift;
static PyObject *__pyx_n_s_shifted;
static PyObject *__pyx_n_s_show;
static PyObject *__pyx_n_s_sin;
static PyObject *__pyx_n_s_sinh;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_slice;
static PyObject *__pyx_n_s_sliced;
static PyObject *__pyx_n_s_slope;
static PyObject *__pyx_n_u_smooth;
static PyObject *__pyx_n_s_sqrt;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_u_start;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_n_s_stretch;
static PyObject *__pyx_n_s_stretched;
static PyObject *__pyx_kp_s_strided_and_direct;
static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
static PyObject *__pyx_kp_s_strided_and_indirect;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_tan;
static PyObject *__pyx_n_s_tanh;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_kp_u_the_stretch_factor_cannot_be_0;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_trapz_integrate_between;
static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
static PyObject *__pyx_n_s_unique;
static PyObject *__pyx_n_s_unpack;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_which;
static PyObject *__pyx_n_s_wrap;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_x0;
static PyObject *__pyx_n_s_x1;
static PyObject *__pyx_n_s_xa;
static PyObject *__pyx_n_s_xb;
static PyObject *__pyx_n_s_xend;
static PyObject *__pyx_n_s_xs;
static PyObject *__pyx_kp_u_xs_and_ys_must_be_of_equal_lengt;
static PyObject *__pyx_n_s_xstart;
static PyObject *__pyx_n_s_xtol;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_y0;
static PyObject *__pyx_n_s_y1;
static PyObject *__pyx_n_s_ys;
static PyObject *__pyx_kp_u_zero_of_function_cannot_be_found;
static PyObject *__pyx_n_s_zeros;
static PyObject *__pyx_pf_4bpf4_4core_setA4(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_freq); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_2_array_issorted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_xs); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_4_get_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface__asbpf(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_2ntodx(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_v_N); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_4dxton(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_dx); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_6bounds(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_2x0___get__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_2x1___get__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_8__add__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_10__sub__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_12__mul__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_14__div__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
#endif
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_16__truediv__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_18__pow__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, CYTHON_UNUSED PyObject *__pyx_v_modulo); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_20__neg__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_22__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_24__abs__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_26__or__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_28__rshift__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_30__lshift__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_32__xor__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_34__richcmp__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_t); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_36_get_points_for_rendering(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_v_n); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_38render(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_interpolation); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_40plot(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_kind, int __pyx_v_n, PyObject *__pyx_v_show, PyObject *__pyx_v_axes, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_42sampled(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_dx, PyObject *__pyx_v_interpolation); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_44sample_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, double __pyx_v_dx, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_46sampled_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, double __pyx_v_dx, PyObject *__pyx_v_interpolation); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_48mapn_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_50map(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_52concat(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_54round(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_56rand(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_58cos(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_60sin(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_62ceil(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_64expon(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_66floor(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_68tanh(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_70abs(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_72sqrt(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_74acos(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_76asin(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_78tan(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_80sinh(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_82log10(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_84log(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_base); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_86m2f(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_88f2m(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_90db2amp(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_92amp2db(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_94clip(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_y0, double __pyx_v_y1); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_96derivative(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_98integrated(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_100integrate(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_102trapz_integrate_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_104integrate_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_106mean(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_108zeros(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_h, int __pyx_v_N, double __pyx_v_x0, double __pyx_v_x1, int __pyx_v_maxzeros); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_110max(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_112min(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_114__reduce__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_116__call__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_118keep_slope(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_epsilon); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_120outbound(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_y0, double __pyx_v_y1); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_122apply(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_124preapply(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_126periodic(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_128stretched(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_rx, double __pyx_v_fixpoint); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_130fit_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_132shifted(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_dx); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_134inverted(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_136_slice(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_138__getitem__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_slice); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_140fromseq(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_points, PyObject *__pyx_v_kws); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_142copy(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_144__repr__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_146debug(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_4bpf4_4core_7BpfBase___cinit__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self); /* proto */
static void __pyx_pf_4bpf4_4core_7BpfBase_2__dealloc__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_7BpfBase_4__init__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_10descriptor___get__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_6outbound(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, double __pyx_v_y0, double __pyx_v_y1); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_8__getstate__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_10__setstate__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_12mapn_between(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, int __pyx_v_n, double __pyx_v_xstart, double __pyx_v_xend, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_14_mapn_between(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, int __pyx_v_n, double __pyx_v_xstart, double __pyx_v_xend, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_16__repr__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_18stretch(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, double __pyx_v_rx); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_20shift(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, double __pyx_v_dx); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_22points(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self); /* proto */
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_pf_4bpf4_4core_7BpfBase_24clone_with_new_data(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, PyArrayObject *__pyx_v_xs, PyArrayObject *__pyx_v_ys); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_26insertpoint(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, double __pyx_v_x, double __pyx_v_y); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_28removepoint(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, double __pyx_v_x); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_30segments(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_3exp___get__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_6Linear___init__(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_6Linear_2_get_points_for_rendering(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self, CYTHON_UNUSED int __pyx_v_n); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_6Linear_4integrate_between(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_6Linear_6sliced(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_6Linear_8inverted(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_6Linear_10flatpairs(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_6Smooth___init__(struct __pyx_obj_4bpf4_4core_Smooth *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, int __pyx_v_numiter); /* proto */
static int __pyx_pf_4bpf4_4core_8Smoother___init__(struct __pyx_obj_4bpf4_4core_Smoother *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys); /* proto */
static int __pyx_pf_4bpf4_4core_7Halfcos___init__(struct __pyx_obj_4bpf4_4core_Halfcos *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, double __pyx_v_exp, int __pyx_v_numiter); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Halfcos_2__getstate__(struct __pyx_obj_4bpf4_4core_Halfcos *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Halfcos_4__repr__(struct __pyx_obj_4bpf4_4core_Halfcos *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_8Halfcosm___init__(struct __pyx_obj_4bpf4_4core_Halfcosm *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, double __pyx_v_exp, int __pyx_v_numiter); /* proto */
static int __pyx_pf_4bpf4_4core_5Expon___init__(struct __pyx_obj_4bpf4_4core_Expon *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, double __pyx_v_exp, int __pyx_v_numiter); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Expon_2__getstate__(struct __pyx_obj_4bpf4_4core_Expon *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Expon_4__setstate__(struct __pyx_obj_4bpf4_4core_Expon *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Expon_6__repr__(struct __pyx_obj_4bpf4_4core_Expon *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_6Exponm___init__(struct __pyx_obj_4bpf4_4core_Exponm *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, double __pyx_v_exp, int __pyx_v_numiter); /* proto */
static int __pyx_pf_4bpf4_4core_10NoInterpol___init__(struct __pyx_obj_4bpf4_4core_NoInterpol *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys); /* proto */
static int __pyx_pf_4bpf4_4core_7Nearest___init__(struct __pyx_obj_4bpf4_4core_Nearest *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Nearest_2__getstate__(struct __pyx_obj_4bpf4_4core_Nearest *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_7Sampled___init__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, PyObject *__pyx_v_samples, double __pyx_v_dx, double __pyx_v_x0, PyObject *__pyx_v_interpolation); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_10samplerate___get__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_2xs___get__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_2points(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_13interpolation___get__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_7Sampled_13interpolation_2__set__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, PyObject *__pyx_v_interpolation); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_2dx___get__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_4set_interpolation(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, PyObject *__pyx_v_interpolation); /* proto */
static void __pyx_pf_4bpf4_4core_7Sampled_6__dealloc__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_8__getstate__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_10mapn_between(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_12fromseq(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kws); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_14_get_points_for_rendering(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, CYTHON_UNUSED int __pyx_v_n); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_16segments(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_19integrate(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_21integrate_between(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_23derivative(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_25inverted(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_27flatpairs(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7Sampled_2ys___get__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_6Spline___init__(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys); /* proto */
static void __pyx_pf_4bpf4_4core_6Spline_2__dealloc__(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_6Spline_4__getstate__(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_6Spline_6points(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_6Spline_8segments(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_7USpline___init__(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7USpline_2__call__(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7USpline_4map(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7USpline_6mapn_between(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7USpline_7_spline___get__(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_7USpline_8segments(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_11_BpfConcat2___getstate__(struct __pyx_obj_4bpf4_4core__BpfConcat2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_11_BpfConcat2_2__setstate__(struct __pyx_obj_4bpf4_4core__BpfConcat2 *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static int __pyx_pf_4bpf4_4core_5Slope___init__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, double __pyx_v_slope, double __pyx_v_offset, PyObject *__pyx_v_bounds); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Slope_2_slice(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Slope_4__add__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Slope_6__sub__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Slope_8mapn_between(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Slope_10__mul__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Slope_12__getstate__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Slope_5slope___get__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_5Slope_5slope_2__set__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Slope_6offset___get__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_5Slope_6offset_2__set__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_11_BpfCompose___getstate__(struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_11_BpfCompose_2__setstate__(struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_11_BpfCompose_4mapn_between(struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static int __pyx_pf_4bpf4_4core_10_BpfConcat___cinit__(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self, PyObject *__pyx_v_xs, CYTHON_UNUSED PyObject *__pyx_v_bpfs); /* proto */
static int __pyx_pf_4bpf4_4core_10_BpfConcat_2__init__(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_bpfs); /* proto */
static void __pyx_pf_4bpf4_4core_10_BpfConcat_4__dealloc__(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_10_BpfConcat_6concat(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other, double __pyx_v_fadetime, PyObject *__pyx_v_fadeshape); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_10_BpfConcat_8__getstate__(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_9_BpfBlend___init__(struct __pyx_obj_4bpf4_4core__BpfBlend *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_which); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_9_BpfBlend_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfBlend *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_14_BpfBlendConst___init__(struct __pyx_obj_4bpf4_4core__BpfBlendConst *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b, double __pyx_v_which); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfBlendConst_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfBlendConst *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_5Multi___cinit__(struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self, PyObject *__pyx_v_xs, CYTHON_UNUSED PyObject *__pyx_v_ys, CYTHON_UNUSED PyObject *__pyx_v_interpolations); /* proto */
static int __pyx_pf_4bpf4_4core_5Multi_2__init__(struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, PyObject *__pyx_v_interpolations); /* proto */
static void __pyx_pf_4bpf4_4core_5Multi_4__dealloc__(struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Multi_6__getstate__(struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Multi_8segments(struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_6_FunctionWrap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f, PyObject *__pyx_v_bounds); /* proto */
static int __pyx_pf_4bpf4_4core_20_FunctionWrap_Object___init__(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_bounds); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_20_FunctionWrap_Object_2__getstate__(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_20_FunctionWrap_Object_4_slice(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_20_FunctionWrap_Object_6map(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_20_FunctionWrap_Object_8mapn_between(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static int __pyx_pf_4bpf4_4core_5Const___init__(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, double __pyx_v_value, PyObject *__pyx_v_bounds); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Const_2__call__(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Const_4__getstate__(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Const_6_get_points_for_rendering(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, CYTHON_UNUSED int __pyx_v_n); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Const_8__getitem__(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, PyObject *__pyx_v_slice); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_5Const_10mapn_between(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static int __pyx_pf_4bpf4_4core_9_BpfBinOp___init__(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b, PyObject *__pyx_v_bounds); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_9_BpfBinOp_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_9_BpfBinOp_4_get_xs_for_rendering(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, int __pyx_v_n); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_9_BpfBinOp_6mapn_between(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_9_BpfBinOp_8map(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_BpfUnaryFunc___reduce__(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_BpfUnaryFunc_2__setstate__(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_BpfUnaryFunc_4mapn_between(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_BpfUnaryFunc_6map(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out); /* proto */
static int __pyx_pf_4bpf4_4core_11_BpfUnaryOp___init__(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_11_BpfUnaryOp_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_11_BpfUnaryOp_4_get_xs_for_rendering(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, int __pyx_v_n); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_11_BpfUnaryOp_6mapn_between(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_11_BpfUnaryOp_8map(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out); /* proto */
static int __pyx_pf_4bpf4_4core_14_BpfBinOpConst___init__(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, double __pyx_v_b, PyObject *__pyx_v_bounds, CYTHON_UNUSED PyObject *__pyx_v_op); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfBinOpConst_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfBinOpConst_4_get_xs_for_rendering(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self, int __pyx_v_n); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfBinOpConst_6map(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_BpfLambdaAdd_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaAdd *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_18_BpfLambdaAddConst___add__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_18_BpfLambdaAddConst_2integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaAddConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_BpfLambdaSub_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaSub *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfLambdaRSub_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaRSub *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_18_BpfLambdaSubConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaSubConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_19_BpfLambdaRSubConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaRSubConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_18_BpfLambdaMulConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaMulConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N); /* proto */
static int __pyx_pf_4bpf4_4core_13_BpfLambdaLog___init__(struct __pyx_obj_4bpf4_4core__BpfLambdaLog *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, double __pyx_v_b, PyObject *__pyx_v_bounds, PyObject *__pyx_v_op); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfLambdaClip_mapn_between(struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfLambdaClip_2__reduce__(struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfLambdaClip_4__setstate__(struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static int __pyx_pf_4bpf4_4core_9_BpfDeriv___init__(struct __pyx_obj_4bpf4_4core__BpfDeriv *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, double __pyx_v_h); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_9_BpfDeriv_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfDeriv *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_12_BpfInverted___init__(struct __pyx_obj_4bpf4_4core__BpfInverted *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12_BpfInverted_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfInverted *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_13_BpfIntegrate___init__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, PyObject *__pyx_v_N, PyObject *__pyx_v_bounds, double __pyx_v_min_N_ratio, double __pyx_v_Nexp, int __pyx_v_oversample); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_BpfIntegrate_2mapn_between(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_BpfIntegrate_4derivative(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_BpfIntegrate_6__getstate__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_BpfIntegrate_5debug___get__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_13_BpfIntegrate_5debug_2__set__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_BpfIntegrate_10oversample___get__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_13_BpfIntegrate_10oversample_2__set__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_4bpf4_4core_12_BpfPeriodic___init__(struct __pyx_obj_4bpf4_4core__BpfPeriodic *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12_BpfPeriodic_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfPeriodic *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_14_BpfProjection___init__(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, double __pyx_v_rx, double __pyx_v_dx, double __pyx_v_offset, PyObject *__pyx_v_bounds); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfProjection_2fixpoint(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfProjection_4__getstate__(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfProjection_2dx___get__(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfProjection_2rx___get__(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14_BpfProjection_6offset___get__(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_13_BpfKeepSlope___init__(struct __pyx_obj_4bpf4_4core__BpfKeepSlope *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, double __pyx_v_EPSILON); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_BpfKeepSlope_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfKeepSlope *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop___reduce__(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_2__setstate__(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_4outbound_set(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, double __pyx_v_y0, double __pyx_v_y1); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_6outbound(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, double __pyx_v_y0, PyObject *__pyx_v_y1); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_8integrate_between(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_10mapn_between(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_3_y0___get__(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_3_y1___get__(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_13outbound_mode___get__(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_new(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, double __pyx_v_x0, double __pyx_v_x1, int __pyx_v_outbound_mode, double __pyx_v_outbound0, double __pyx_v_outbound1); /* proto */
static int __pyx_pf_4bpf4_4core_13_MultipleBpfs___init__(struct __pyx_obj_4bpf4_4core__MultipleBpfs *__pyx_v_self, PyObject *__pyx_v_bpfs); /* proto */
static void __pyx_pf_4bpf4_4core_13_MultipleBpfs_2__dealloc__(struct __pyx_obj_4bpf4_4core__MultipleBpfs *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_MultipleBpfs_4_calculate_bounds(struct __pyx_obj_4bpf4_4core__MultipleBpfs *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_13_MultipleBpfs_6__getstate__(struct __pyx_obj_4bpf4_4core__MultipleBpfs *__pyx_v_self); /* proto */
static int __pyx_pf_4bpf4_4core_3Max___init__(struct __pyx_obj_4bpf4_4core_Max *__pyx_v_self, PyObject *__pyx_v_bpfs); /* proto */
static int __pyx_pf_4bpf4_4core_3Min___init__(struct __pyx_obj_4bpf4_4core_Min *__pyx_v_self, PyObject *__pyx_v_bpfs); /* proto */
static int __pyx_pf_4bpf4_4core_10_BpfSelect___init__(struct __pyx_obj_4bpf4_4core__BpfSelect *__pyx_v_self, PyObject *__pyx_v_which, PyObject *__pyx_v_bpfs, PyObject *__pyx_v_shape); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_10brentq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bpf, double __pyx_v_x0, double __pyx_v_xa, double __pyx_v_xb, double __pyx_v_xtol, double __pyx_v_rtol, PyObject *__pyx_v_max_iter); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_12blend(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_mix); /* proto */
static PyObject *__pyx_pf_4bpf4_4core_14bpf_zero_crossings(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b, double __pyx_v_h, int __pyx_v_N, double __pyx_v_x0, double __pyx_v_x1, int __pyx_v_maxzeros); /* proto */
static PyObject *__pyx_pf_11cfunc_dot_to_py_43__Pyx_CFunc_double____double____nogil_to_py_wrap(PyObject *__pyx_self, double __pyx_v_x); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_4bpf4_4core_BpfInterface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_BpfBase(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Linear(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Smooth(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Smoother(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Halfcos(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Halfcosm(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Expon(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Exponm(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_NoInterpol(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Nearest(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Sampled(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Spline(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_USpline(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfConcat2(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Slope(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfCompose(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfConcat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfBlend(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfBlendConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Multi(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__FunctionWrap_Object(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__FunctionWrap_Object_OutboundConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Const(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfBinOp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfUnaryFunc(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfUnaryOp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfBinOpConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaAdd(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaAddConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaSub(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaRSub(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaSubConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaRSubConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaMul(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaMulConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaPow(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaPowConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaRPowConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaDiv(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaDivConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaMod(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaModConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaRDiv(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaRDivConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaGreaterThan(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaGreaterOrEqualThan(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaGreaterThanConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaLowerThan(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaLowerThanConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaLowerOrEqualThan(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaLowerOrEqualThanConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaEqual(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaEqualConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaUnequal(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaUnequalConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfMaxConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfMinConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaLog(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaRound(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfRand(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfM2F(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfF2M(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__Bpf_db2amp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__Bpf_amp2db(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaClip(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfDeriv(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfInverted(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfIntegrate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfPeriodic(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfProjection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfKeepSlope(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfCrop(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__MultipleBpfs(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Max(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core_Min(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core__BpfSelect(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core___pyx_scope_struct__segments(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core___pyx_scope_struct_1_segments(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core___pyx_scope_struct_2_segments(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core___pyx_scope_struct_3_segments(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4bpf4_4core___pyx_scope_struct_4_segments(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_float_0_;
static PyObject *__pyx_float_1_;
static PyObject *__pyx_float_0_5;
static PyObject *__pyx_float_inf;
static PyObject *__pyx_float_neg_inf;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_100;
static PyObject *__pyx_int_200;
static PyObject *__pyx_int_99999;
static PyObject *__pyx_int_184977713;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_neg_2;
static double __pyx_k__7;
static double __pyx_k__9;
static double __pyx_k__10;
static double __pyx_k__36;
static double __pyx_k__37;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_slice__14;
static PyObject *__pyx_slice__19;
static PyObject *__pyx_slice__20;
static PyObject *__pyx_slice__25;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__161;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__177;
static PyObject *__pyx_tuple__179;
static PyObject *__pyx_tuple__181;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__206;
static PyObject *__pyx_tuple__208;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__214;
static PyObject *__pyx_tuple__216;
static PyObject *__pyx_tuple__218;
static PyObject *__pyx_tuple__220;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_tuple__226;
static PyObject *__pyx_tuple__228;
static PyObject *__pyx_tuple__230;
static PyObject *__pyx_tuple__232;
static PyObject *__pyx_tuple__234;
static PyObject *__pyx_tuple__236;
static PyObject *__pyx_tuple__237;
static PyObject *__pyx_tuple__239;
static PyObject *__pyx_tuple__241;
static PyObject *__pyx_tuple__243;
static PyObject *__pyx_tuple__245;
static PyObject *__pyx_tuple__247;
static PyObject *__pyx_tuple__249;
static PyObject *__pyx_tuple__251;
static PyObject *__pyx_tuple__252;
static PyObject *__pyx_tuple__254;
static PyObject *__pyx_tuple__256;
static PyObject *__pyx_tuple__257;
static PyObject *__pyx_tuple__259;
static PyObject *__pyx_tuple__261;
static PyObject *__pyx_tuple__263;
static PyObject *__pyx_tuple__265;
static PyObject *__pyx_tuple__267;
static PyObject *__pyx_tuple__269;
static PyObject *__pyx_tuple__271;
static PyObject *__pyx_tuple__273;
static PyObject *__pyx_tuple__275;
static PyObject *__pyx_tuple__277;
static PyObject *__pyx_tuple__279;
static PyObject *__pyx_tuple__281;
static PyObject *__pyx_tuple__283;
static PyObject *__pyx_tuple__284;
static PyObject *__pyx_tuple__286;
static PyObject *__pyx_tuple__287;
static PyObject *__pyx_tuple__289;
static PyObject *__pyx_tuple__291;
static PyObject *__pyx_tuple__293;
static PyObject *__pyx_tuple__295;
static PyObject *__pyx_tuple__297;
static PyObject *__pyx_tuple__299;
static PyObject *__pyx_tuple__301;
static PyObject *__pyx_tuple__303;
static PyObject *__pyx_tuple__305;
static PyObject *__pyx_tuple__307;
static PyObject *__pyx_tuple__309;
static PyObject *__pyx_tuple__311;
static PyObject *__pyx_tuple__313;
static PyObject *__pyx_tuple__315;
static PyObject *__pyx_tuple__317;
static PyObject *__pyx_tuple__319;
static PyObject *__pyx_tuple__321;
static PyObject *__pyx_tuple__323;
static PyObject *__pyx_tuple__325;
static PyObject *__pyx_tuple__327;
static PyObject *__pyx_tuple__329;
static PyObject *__pyx_tuple__331;
static PyObject *__pyx_tuple__333;
static PyObject *__pyx_tuple__335;
static PyObject *__pyx_tuple__337;
static PyObject *__pyx_tuple__339;
static PyObject *__pyx_tuple__341;
static PyObject *__pyx_tuple__343;
static PyObject *__pyx_tuple__345;
static PyObject *__pyx_tuple__347;
static PyObject *__pyx_tuple__349;
static PyObject *__pyx_tuple__351;
static PyObject *__pyx_tuple__353;
static PyObject *__pyx_tuple__355;
static PyObject *__pyx_tuple__357;
static PyObject *__pyx_tuple__359;
static PyObject *__pyx_tuple__361;
static PyObject *__pyx_tuple__363;
static PyObject *__pyx_tuple__365;
static PyObject *__pyx_tuple__367;
static PyObject *__pyx_tuple__369;
static PyObject *__pyx_tuple__371;
static PyObject *__pyx_tuple__373;
static PyObject *__pyx_tuple__375;
static PyObject *__pyx_tuple__377;
static PyObject *__pyx_tuple__379;
static PyObject *__pyx_tuple__381;
static PyObject *__pyx_tuple__383;
static PyObject *__pyx_tuple__385;
static PyObject *__pyx_tuple__387;
static PyObject *__pyx_tuple__389;
static PyObject *__pyx_tuple__391;
static PyObject *__pyx_tuple__393;
static PyObject *__pyx_tuple__394;
static PyObject *__pyx_tuple__395;
static PyObject *__pyx_tuple__396;
static PyObject *__pyx_tuple__397;
static PyObject *__pyx_tuple__398;
static PyObject *__pyx_codeobj__26;
static PyObject *__pyx_codeobj__28;
static PyObject *__pyx_codeobj__29;
static PyObject *__pyx_codeobj__31;
static PyObject *__pyx_codeobj__33;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__63;
static PyObject *__pyx_codeobj__66;
static PyObject *__pyx_codeobj__68;
static PyObject *__pyx_codeobj__70;
static PyObject *__pyx_codeobj__72;
static PyObject *__pyx_codeobj__74;
static PyObject *__pyx_codeobj__76;
static PyObject *__pyx_codeobj__78;
static PyObject *__pyx_codeobj__80;
static PyObject *__pyx_codeobj__82;
static PyObject *__pyx_codeobj__84;
static PyObject *__pyx_codeobj__86;
static PyObject *__pyx_codeobj__88;
static PyObject *__pyx_codeobj__90;
static PyObject *__pyx_codeobj__92;
static PyObject *__pyx_codeobj__94;
static PyObject *__pyx_codeobj__96;
static PyObject *__pyx_codeobj__98;
static PyObject *__pyx_codeobj__100;
static PyObject *__pyx_codeobj__102;
static PyObject *__pyx_codeobj__104;
static PyObject *__pyx_codeobj__106;
static PyObject *__pyx_codeobj__108;
static PyObject *__pyx_codeobj__110;
static PyObject *__pyx_codeobj__112;
static PyObject *__pyx_codeobj__114;
static PyObject *__pyx_codeobj__116;
static PyObject *__pyx_codeobj__118;
static PyObject *__pyx_codeobj__120;
static PyObject *__pyx_codeobj__122;
static PyObject *__pyx_codeobj__124;
static PyObject *__pyx_codeobj__126;
static PyObject *__pyx_codeobj__128;
static PyObject *__pyx_codeobj__130;
static PyObject *__pyx_codeobj__132;
static PyObject *__pyx_codeobj__134;
static PyObject *__pyx_codeobj__136;
static PyObject *__pyx_codeobj__138;
static PyObject *__pyx_codeobj__140;
static PyObject *__pyx_codeobj__142;
static PyObject *__pyx_codeobj__144;
static PyObject *__pyx_codeobj__146;
static PyObject *__pyx_codeobj__148;
static PyObject *__pyx_codeobj__150;
static PyObject *__pyx_codeobj__152;
static PyObject *__pyx_codeobj__154;
static PyObject *__pyx_codeobj__156;
static PyObject *__pyx_codeobj__158;
static PyObject *__pyx_codeobj__160;
static PyObject *__pyx_codeobj__162;
static PyObject *__pyx_codeobj__164;
static PyObject *__pyx_codeobj__166;
static PyObject *__pyx_codeobj__168;
static PyObject *__pyx_codeobj__170;
static PyObject *__pyx_codeobj__172;
static PyObject *__pyx_codeobj__174;
static PyObject *__pyx_codeobj__176;
static PyObject *__pyx_codeobj__178;
static PyObject *__pyx_codeobj__180;
static PyObject *__pyx_codeobj__182;
static PyObject *__pyx_codeobj__184;
static PyObject *__pyx_codeobj__186;
static PyObject *__pyx_codeobj__188;
static PyObject *__pyx_codeobj__190;
static PyObject *__pyx_codeobj__192;
static PyObject *__pyx_codeobj__194;
static PyObject *__pyx_codeobj__196;
static PyObject *__pyx_codeobj__198;
static PyObject *__pyx_codeobj__200;
static PyObject *__pyx_codeobj__202;
static PyObject *__pyx_codeobj__204;
static PyObject *__pyx_codeobj__207;
static PyObject *__pyx_codeobj__209;
static PyObject *__pyx_codeobj__211;
static PyObject *__pyx_codeobj__213;
static PyObject *__pyx_codeobj__215;
static PyObject *__pyx_codeobj__217;
static PyObject *__pyx_codeobj__219;
static PyObject *__pyx_codeobj__221;
static PyObject *__pyx_codeobj__223;
static PyObject *__pyx_codeobj__225;
static PyObject *__pyx_codeobj__227;
static PyObject *__pyx_codeobj__229;
static PyObject *__pyx_codeobj__231;
static PyObject *__pyx_codeobj__233;
static PyObject *__pyx_codeobj__235;
static PyObject *__pyx_codeobj__238;
static PyObject *__pyx_codeobj__240;
static PyObject *__pyx_codeobj__242;
static PyObject *__pyx_codeobj__244;
static PyObject *__pyx_codeobj__246;
static PyObject *__pyx_codeobj__248;
static PyObject *__pyx_codeobj__250;
static PyObject *__pyx_codeobj__253;
static PyObject *__pyx_codeobj__255;
static PyObject *__pyx_codeobj__258;
static PyObject *__pyx_codeobj__260;
static PyObject *__pyx_codeobj__262;
static PyObject *__pyx_codeobj__264;
static PyObject *__pyx_codeobj__266;
static PyObject *__pyx_codeobj__268;
static PyObject *__pyx_codeobj__270;
static PyObject *__pyx_codeobj__272;
static PyObject *__pyx_codeobj__274;
static PyObject *__pyx_codeobj__276;
static PyObject *__pyx_codeobj__278;
static PyObject *__pyx_codeobj__280;
static PyObject *__pyx_codeobj__282;
static PyObject *__pyx_codeobj__285;
static PyObject *__pyx_codeobj__288;
static PyObject *__pyx_codeobj__290;
static PyObject *__pyx_codeobj__292;
static PyObject *__pyx_codeobj__294;
static PyObject *__pyx_codeobj__296;
static PyObject *__pyx_codeobj__298;
static PyObject *__pyx_codeobj__300;
static PyObject *__pyx_codeobj__302;
static PyObject *__pyx_codeobj__304;
static PyObject *__pyx_codeobj__306;
static PyObject *__pyx_codeobj__308;
static PyObject *__pyx_codeobj__310;
static PyObject *__pyx_codeobj__312;
static PyObject *__pyx_codeobj__314;
static PyObject *__pyx_codeobj__316;
static PyObject *__pyx_codeobj__318;
static PyObject *__pyx_codeobj__320;
static PyObject *__pyx_codeobj__322;
static PyObject *__pyx_codeobj__324;
static PyObject *__pyx_codeobj__326;
static PyObject *__pyx_codeobj__328;
static PyObject *__pyx_codeobj__330;
static PyObject *__pyx_codeobj__332;
static PyObject *__pyx_codeobj__334;
static PyObject *__pyx_codeobj__336;
static PyObject *__pyx_codeobj__338;
static PyObject *__pyx_codeobj__340;
static PyObject *__pyx_codeobj__342;
static PyObject *__pyx_codeobj__344;
static PyObject *__pyx_codeobj__346;
static PyObject *__pyx_codeobj__348;
static PyObject *__pyx_codeobj__350;
static PyObject *__pyx_codeobj__352;
static PyObject *__pyx_codeobj__354;
static PyObject *__pyx_codeobj__356;
static PyObject *__pyx_codeobj__358;
static PyObject *__pyx_codeobj__360;
static PyObject *__pyx_codeobj__362;
static PyObject *__pyx_codeobj__364;
static PyObject *__pyx_codeobj__366;
static PyObject *__pyx_codeobj__368;
static PyObject *__pyx_codeobj__370;
static PyObject *__pyx_codeobj__372;
static PyObject *__pyx_codeobj__374;
static PyObject *__pyx_codeobj__376;
static PyObject *__pyx_codeobj__378;
static PyObject *__pyx_codeobj__380;
static PyObject *__pyx_codeobj__382;
static PyObject *__pyx_codeobj__384;
static PyObject *__pyx_codeobj__386;
static PyObject *__pyx_codeobj__388;
static PyObject *__pyx_codeobj__390;
static PyObject *__pyx_codeobj__392;
static PyObject *__pyx_codeobj__399;
/* Late includes */

/* "bpf4/core.pyx":114
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_linear(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     return y0 + (y1 - y0) * ((x - x0) / (x1 - x0))
 * 
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_linear(CYTHON_UNUSED __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self, double __pyx_v_x, double __pyx_v_x0, double __pyx_v_y0, double __pyx_v_x1, double __pyx_v_y1) {
  double __pyx_r;

  /* "bpf4/core.pyx":115
 * @cython.cdivision(True)
 * cdef inline double intrp_linear(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 *     return y0 + (y1 - y0) * ((x - x0) / (x1 - x0))             # <<<<<<<<<<<<<<
 * 
 * cdef inline double intrp_nointerpol(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 */
  __pyx_r = (__pyx_v_y0 + ((__pyx_v_y1 - __pyx_v_y0) * ((__pyx_v_x - __pyx_v_x0) / (__pyx_v_x1 - __pyx_v_x0))));
  goto __pyx_L0;

  /* "bpf4/core.pyx":114
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_linear(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     return y0 + (y1 - y0) * ((x - x0) / (x1 - x0))
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":117
 *     return y0 + (y1 - y0) * ((x - x0) / (x1 - x0))
 * 
 * cdef inline double intrp_nointerpol(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     return y0 if x < x1 else y1
 * 
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_nointerpol(CYTHON_UNUSED __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self, double __pyx_v_x, CYTHON_UNUSED double __pyx_v_x0, double __pyx_v_y0, double __pyx_v_x1, double __pyx_v_y1) {
  double __pyx_r;
  double __pyx_t_1;

  /* "bpf4/core.pyx":118
 * 
 * cdef inline double intrp_nointerpol(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 *     return y0 if x < x1 else y1             # <<<<<<<<<<<<<<
 * 
 * cdef inline double intrp_nearest(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 */
  if (((__pyx_v_x < __pyx_v_x1) != 0)) {
    __pyx_t_1 = __pyx_v_y0;
  } else {
    __pyx_t_1 = __pyx_v_y1;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "bpf4/core.pyx":117
 *     return y0 + (y1 - y0) * ((x - x0) / (x1 - x0))
 * 
 * cdef inline double intrp_nointerpol(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     return y0 if x < x1 else y1
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":120
 *     return y0 if x < x1 else y1
 * 
 * cdef inline double intrp_nearest(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     if (x - x0) <= (x1 - x):
 *         return y0
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_nearest(CYTHON_UNUSED __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self, double __pyx_v_x, double __pyx_v_x0, double __pyx_v_y0, double __pyx_v_x1, double __pyx_v_y1) {
  double __pyx_r;
  int __pyx_t_1;

  /* "bpf4/core.pyx":121
 * 
 * cdef inline double intrp_nearest(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 *     if (x - x0) <= (x1 - x):             # <<<<<<<<<<<<<<
 *         return y0
 *     return y1
 */
  __pyx_t_1 = (((__pyx_v_x - __pyx_v_x0) <= (__pyx_v_x1 - __pyx_v_x)) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":122
 * cdef inline double intrp_nearest(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 *     if (x - x0) <= (x1 - x):
 *         return y0             # <<<<<<<<<<<<<<
 *     return y1
 * 
 */
    __pyx_r = __pyx_v_y0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":121
 * 
 * cdef inline double intrp_nearest(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 *     if (x - x0) <= (x1 - x):             # <<<<<<<<<<<<<<
 *         return y0
 *     return y1
 */
  }

  /* "bpf4/core.pyx":123
 *     if (x - x0) <= (x1 - x):
 *         return y0
 *     return y1             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
  __pyx_r = __pyx_v_y1;
  goto __pyx_L0;

  /* "bpf4/core.pyx":120
 *     return y0 if x < x1 else y1
 * 
 * cdef inline double intrp_nearest(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     if (x - x0) <= (x1 - x):
 *         return y0
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":126
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_halfcos(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         double dx, y
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_halfcos(__pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self, double __pyx_v_x, double __pyx_v_x0, double __pyx_v_y0, double __pyx_v_x1, double __pyx_v_y1) {
  double __pyx_v_dx;
  double __pyx_v_y;
  double __pyx_v_x1x0;
  CYTHON_UNUSED int __pyx_v_i;
  double __pyx_r;
  int __pyx_t_1;
  long __pyx_t_2;
  long __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":129
 *     cdef:
 *         double dx, y
 *         double x1x0 = x1 - x0             # <<<<<<<<<<<<<<
 *         int i
 *     if self.numiter > 1:
 */
  __pyx_v_x1x0 = (__pyx_v_x1 - __pyx_v_x0);

  /* "bpf4/core.pyx":131
 *         double x1x0 = x1 - x0
 *         int i
 *     if self.numiter > 1:             # <<<<<<<<<<<<<<
 *         for i in range(self.numiter - 1):
 *             dx = (x - x0) / x1x0
 */
  __pyx_t_1 = ((__pyx_v_self->numiter > 1) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":132
 *         int i
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):             # <<<<<<<<<<<<<<
 *             dx = (x - x0) / x1x0
 *             dx = (dx + 1) * 3.14159265358979323846
 */
    __pyx_t_2 = (__pyx_v_self->numiter - 1);
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "bpf4/core.pyx":133
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):
 *             dx = (x - x0) / x1x0             # <<<<<<<<<<<<<<
 *             dx = (dx + 1) * 3.14159265358979323846
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0
 */
      __pyx_v_dx = ((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0);

      /* "bpf4/core.pyx":134
 *         for i in range(self.numiter - 1):
 *             dx = (x - x0) / x1x0
 *             dx = (dx + 1) * 3.14159265358979323846             # <<<<<<<<<<<<<<
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0
 *     dx = (x - x0) / x1x0
 */
      __pyx_v_dx = ((__pyx_v_dx + 1.0) * 3.14159265358979323846);

      /* "bpf4/core.pyx":135
 *             dx = (x - x0) / x1x0
 *             dx = (dx + 1) * 3.14159265358979323846
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0             # <<<<<<<<<<<<<<
 *     dx = (x - x0) / x1x0
 *     dx = (dx + 1) * 3.14159265358979323846
 */
      __pyx_v_x = (__pyx_v_x0 + ((__pyx_v_x1x0 * (1.0 + cos(__pyx_v_dx))) / 2.0));
    }

    /* "bpf4/core.pyx":131
 *         double x1x0 = x1 - x0
 *         int i
 *     if self.numiter > 1:             # <<<<<<<<<<<<<<
 *         for i in range(self.numiter - 1):
 *             dx = (x - x0) / x1x0
 */
  }

  /* "bpf4/core.pyx":136
 *             dx = (dx + 1) * 3.14159265358979323846
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0
 *     dx = (x - x0) / x1x0             # <<<<<<<<<<<<<<
 *     dx = (dx + 1) * 3.14159265358979323846
 *     y = y0 + (y1 - y0) * (1 + cos(dx)) / 2.0
 */
  __pyx_v_dx = ((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0);

  /* "bpf4/core.pyx":137
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0
 *     dx = (x - x0) / x1x0
 *     dx = (dx + 1) * 3.14159265358979323846             # <<<<<<<<<<<<<<
 *     y = y0 + (y1 - y0) * (1 + cos(dx)) / 2.0
 *     return y
 */
  __pyx_v_dx = ((__pyx_v_dx + 1.0) * 3.14159265358979323846);

  /* "bpf4/core.pyx":138
 *     dx = (x - x0) / x1x0
 *     dx = (dx + 1) * 3.14159265358979323846
 *     y = y0 + (y1 - y0) * (1 + cos(dx)) / 2.0             # <<<<<<<<<<<<<<
 *     return y
 * 
 */
  __pyx_v_y = (__pyx_v_y0 + (((__pyx_v_y1 - __pyx_v_y0) * (1.0 + cos(__pyx_v_dx))) / 2.0));

  /* "bpf4/core.pyx":139
 *     dx = (dx + 1) * 3.14159265358979323846
 *     y = y0 + (y1 - y0) * (1 + cos(dx)) / 2.0
 *     return y             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
  __pyx_r = __pyx_v_y;
  goto __pyx_L0;

  /* "bpf4/core.pyx":126
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_halfcos(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         double dx, y
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":142
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_halfcosexp(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         double dx
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_halfcosexp(__pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self, double __pyx_v_x, double __pyx_v_x0, double __pyx_v_y0, double __pyx_v_x1, double __pyx_v_y1) {
  double __pyx_v_dx;
  double __pyx_v_x1x0;
  CYTHON_UNUSED int __pyx_v_i;
  double __pyx_v_exp;
  double __pyx_r;
  double __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;

  /* "bpf4/core.pyx":145
 *     cdef:
 *         double dx
 *         double x1x0 = x1 - x0             # <<<<<<<<<<<<<<
 *         int i
 *         double exp = self.exp
 */
  __pyx_v_x1x0 = (__pyx_v_x1 - __pyx_v_x0);

  /* "bpf4/core.pyx":147
 *         double x1x0 = x1 - x0
 *         int i
 *         double exp = self.exp             # <<<<<<<<<<<<<<
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):
 */
  __pyx_t_1 = __pyx_v_self->exp;
  __pyx_v_exp = __pyx_t_1;

  /* "bpf4/core.pyx":148
 *         int i
 *         double exp = self.exp
 *     if self.numiter > 1:             # <<<<<<<<<<<<<<
 *         for i in range(self.numiter - 1):
 *             dx = pow((x - x0) / x1x0, exp)
 */
  __pyx_t_2 = ((__pyx_v_self->numiter > 1) != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":149
 *         double exp = self.exp
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):             # <<<<<<<<<<<<<<
 *             dx = pow((x - x0) / x1x0, exp)
 *             dx = (dx + 1) * 3.14159265358979323846
 */
    __pyx_t_3 = (__pyx_v_self->numiter - 1);
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "bpf4/core.pyx":150
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):
 *             dx = pow((x - x0) / x1x0, exp)             # <<<<<<<<<<<<<<
 *             dx = (dx + 1) * 3.14159265358979323846
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0
 */
      __pyx_v_dx = pow(((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0), __pyx_v_exp);

      /* "bpf4/core.pyx":151
 *         for i in range(self.numiter - 1):
 *             dx = pow((x - x0) / x1x0, exp)
 *             dx = (dx + 1) * 3.14159265358979323846             # <<<<<<<<<<<<<<
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0
 *     dx = pow((x - x0) / x1x0, exp)
 */
      __pyx_v_dx = ((__pyx_v_dx + 1.0) * 3.14159265358979323846);

      /* "bpf4/core.pyx":152
 *             dx = pow((x - x0) / x1x0, exp)
 *             dx = (dx + 1) * 3.14159265358979323846
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0             # <<<<<<<<<<<<<<
 *     dx = pow((x - x0) / x1x0, exp)
 *     dx = (dx + 1) * 3.14159265358979323846
 */
      __pyx_v_x = (__pyx_v_x0 + ((__pyx_v_x1x0 * (1.0 + cos(__pyx_v_dx))) / 2.0));
    }

    /* "bpf4/core.pyx":148
 *         int i
 *         double exp = self.exp
 *     if self.numiter > 1:             # <<<<<<<<<<<<<<
 *         for i in range(self.numiter - 1):
 *             dx = pow((x - x0) / x1x0, exp)
 */
  }

  /* "bpf4/core.pyx":153
 *             dx = (dx + 1) * 3.14159265358979323846
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0
 *     dx = pow((x - x0) / x1x0, exp)             # <<<<<<<<<<<<<<
 *     dx = (dx + 1) * 3.14159265358979323846
 *     return y0 + (y1 - y0) * (1 + cos(dx)) / 2.0
 */
  __pyx_v_dx = pow(((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0), __pyx_v_exp);

  /* "bpf4/core.pyx":154
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0
 *     dx = pow((x - x0) / x1x0, exp)
 *     dx = (dx + 1) * 3.14159265358979323846             # <<<<<<<<<<<<<<
 *     return y0 + (y1 - y0) * (1 + cos(dx)) / 2.0
 * 
 */
  __pyx_v_dx = ((__pyx_v_dx + 1.0) * 3.14159265358979323846);

  /* "bpf4/core.pyx":155
 *     dx = pow((x - x0) / x1x0, exp)
 *     dx = (dx + 1) * 3.14159265358979323846
 *     return y0 + (y1 - y0) * (1 + cos(dx)) / 2.0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_y0 + (((__pyx_v_y1 - __pyx_v_y0) * (1.0 + cos(__pyx_v_dx))) / 2.0));
  goto __pyx_L0;

  /* "bpf4/core.pyx":142
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_halfcosexp(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         double dx
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":159
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_halfcosexpm(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         double dx
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_halfcosexpm(__pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self, double __pyx_v_x, double __pyx_v_x0, double __pyx_v_y0, double __pyx_v_x1, double __pyx_v_y1) {
  double __pyx_v_dx;
  double __pyx_v_x1x0;
  double __pyx_v_exp;
  CYTHON_UNUSED int __pyx_v_i;
  double __pyx_r;
  double __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;

  /* "bpf4/core.pyx":162
 *     cdef:
 *         double dx
 *         double x1x0 = x1 - x0             # <<<<<<<<<<<<<<
 *         double exp = self.exp
 *         int i
 */
  __pyx_v_x1x0 = (__pyx_v_x1 - __pyx_v_x0);

  /* "bpf4/core.pyx":163
 *         double dx
 *         double x1x0 = x1 - x0
 *         double exp = self.exp             # <<<<<<<<<<<<<<
 *         int i
 *     if y1 < y0:
 */
  __pyx_t_1 = __pyx_v_self->exp;
  __pyx_v_exp = __pyx_t_1;

  /* "bpf4/core.pyx":165
 *         double exp = self.exp
 *         int i
 *     if y1 < y0:             # <<<<<<<<<<<<<<
 *         exp = 1/exp
 *     if self.numiter > 1:
 */
  __pyx_t_2 = ((__pyx_v_y1 < __pyx_v_y0) != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":166
 *         int i
 *     if y1 < y0:
 *         exp = 1/exp             # <<<<<<<<<<<<<<
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):
 */
    __pyx_v_exp = (1.0 / __pyx_v_exp);

    /* "bpf4/core.pyx":165
 *         double exp = self.exp
 *         int i
 *     if y1 < y0:             # <<<<<<<<<<<<<<
 *         exp = 1/exp
 *     if self.numiter > 1:
 */
  }

  /* "bpf4/core.pyx":167
 *     if y1 < y0:
 *         exp = 1/exp
 *     if self.numiter > 1:             # <<<<<<<<<<<<<<
 *         for i in range(self.numiter - 1):
 *             dx = pow((x - x0) / x1x0, exp)
 */
  __pyx_t_2 = ((__pyx_v_self->numiter > 1) != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":168
 *         exp = 1/exp
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):             # <<<<<<<<<<<<<<
 *             dx = pow((x - x0) / x1x0, exp)
 *             dx = (dx + 1) * 3.14159265358979323846
 */
    __pyx_t_3 = (__pyx_v_self->numiter - 1);
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "bpf4/core.pyx":169
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):
 *             dx = pow((x - x0) / x1x0, exp)             # <<<<<<<<<<<<<<
 *             dx = (dx + 1) * 3.14159265358979323846
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0
 */
      __pyx_v_dx = pow(((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0), __pyx_v_exp);

      /* "bpf4/core.pyx":170
 *         for i in range(self.numiter - 1):
 *             dx = pow((x - x0) / x1x0, exp)
 *             dx = (dx + 1) * 3.14159265358979323846             # <<<<<<<<<<<<<<
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0
 *     dx = pow((x - x0) / x1x0, exp)
 */
      __pyx_v_dx = ((__pyx_v_dx + 1.0) * 3.14159265358979323846);

      /* "bpf4/core.pyx":171
 *             dx = pow((x - x0) / x1x0, exp)
 *             dx = (dx + 1) * 3.14159265358979323846
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0             # <<<<<<<<<<<<<<
 *     dx = pow((x - x0) / x1x0, exp)
 *     dx = (dx + 1) * 3.14159265358979323846
 */
      __pyx_v_x = (__pyx_v_x0 + ((__pyx_v_x1x0 * (1.0 + cos(__pyx_v_dx))) / 2.0));
    }

    /* "bpf4/core.pyx":167
 *     if y1 < y0:
 *         exp = 1/exp
 *     if self.numiter > 1:             # <<<<<<<<<<<<<<
 *         for i in range(self.numiter - 1):
 *             dx = pow((x - x0) / x1x0, exp)
 */
  }

  /* "bpf4/core.pyx":172
 *             dx = (dx + 1) * 3.14159265358979323846
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0
 *     dx = pow((x - x0) / x1x0, exp)             # <<<<<<<<<<<<<<
 *     dx = (dx + 1) * 3.14159265358979323846
 *     return y0 + (y1 - y0) * (1 + cos(dx)) / 2.0
 */
  __pyx_v_dx = pow(((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0), __pyx_v_exp);

  /* "bpf4/core.pyx":173
 *             x = x0 + x1x0 * (1 + cos(dx)) / 2.0
 *     dx = pow((x - x0) / x1x0, exp)
 *     dx = (dx + 1) * 3.14159265358979323846             # <<<<<<<<<<<<<<
 *     return y0 + (y1 - y0) * (1 + cos(dx)) / 2.0
 * 
 */
  __pyx_v_dx = ((__pyx_v_dx + 1.0) * 3.14159265358979323846);

  /* "bpf4/core.pyx":174
 *     dx = pow((x - x0) / x1x0, exp)
 *     dx = (dx + 1) * 3.14159265358979323846
 *     return y0 + (y1 - y0) * (1 + cos(dx)) / 2.0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_y0 + (((__pyx_v_y1 - __pyx_v_y0) * (1.0 + cos(__pyx_v_dx))) / 2.0));
  goto __pyx_L0;

  /* "bpf4/core.pyx":159
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_halfcosexpm(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         double dx
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":179
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_expon(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         double exp = self.exp
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_expon(__pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self, double __pyx_v_x, double __pyx_v_x0, double __pyx_v_y0, double __pyx_v_x1, double __pyx_v_y1) {
  double __pyx_v_exp;
  double __pyx_v_dx;
  double __pyx_v_x1x0;
  CYTHON_UNUSED int __pyx_v_i;
  double __pyx_r;
  double __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;

  /* "bpf4/core.pyx":181
 * cdef inline double intrp_expon(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 *     cdef:
 *         double exp = self.exp             # <<<<<<<<<<<<<<
 *         double dx
 *         double x1x0 = x1 - x0
 */
  __pyx_t_1 = __pyx_v_self->exp;
  __pyx_v_exp = __pyx_t_1;

  /* "bpf4/core.pyx":183
 *         double exp = self.exp
 *         double dx
 *         double x1x0 = x1 - x0             # <<<<<<<<<<<<<<
 *         int i
 *     if self.numiter > 1:
 */
  __pyx_v_x1x0 = (__pyx_v_x1 - __pyx_v_x0);

  /* "bpf4/core.pyx":185
 *         double x1x0 = x1 - x0
 *         int i
 *     if self.numiter > 1:             # <<<<<<<<<<<<<<
 *         for i in range(self.numiter - 1):
 *             dx = (x - x0) / x1x0
 */
  __pyx_t_2 = ((__pyx_v_self->numiter > 1) != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":186
 *         int i
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):             # <<<<<<<<<<<<<<
 *             dx = (x - x0) / x1x0
 *             x = x0 + pow(dx, exp) * x1x0
 */
    __pyx_t_3 = (__pyx_v_self->numiter - 1);
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "bpf4/core.pyx":187
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):
 *             dx = (x - x0) / x1x0             # <<<<<<<<<<<<<<
 *             x = x0 + pow(dx, exp) * x1x0
 *     dx = (x - x0) / x1x0
 */
      __pyx_v_dx = ((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0);

      /* "bpf4/core.pyx":188
 *         for i in range(self.numiter - 1):
 *             dx = (x - x0) / x1x0
 *             x = x0 + pow(dx, exp) * x1x0             # <<<<<<<<<<<<<<
 *     dx = (x - x0) / x1x0
 *     return y0 + pow(dx, exp) * (y1 - y0)
 */
      __pyx_v_x = (__pyx_v_x0 + (pow(__pyx_v_dx, __pyx_v_exp) * __pyx_v_x1x0));
    }

    /* "bpf4/core.pyx":185
 *         double x1x0 = x1 - x0
 *         int i
 *     if self.numiter > 1:             # <<<<<<<<<<<<<<
 *         for i in range(self.numiter - 1):
 *             dx = (x - x0) / x1x0
 */
  }

  /* "bpf4/core.pyx":189
 *             dx = (x - x0) / x1x0
 *             x = x0 + pow(dx, exp) * x1x0
 *     dx = (x - x0) / x1x0             # <<<<<<<<<<<<<<
 *     return y0 + pow(dx, exp) * (y1 - y0)
 * 
 */
  __pyx_v_dx = ((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0);

  /* "bpf4/core.pyx":190
 *             x = x0 + pow(dx, exp) * x1x0
 *     dx = (x - x0) / x1x0
 *     return y0 + pow(dx, exp) * (y1 - y0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_y0 + (pow(__pyx_v_dx, __pyx_v_exp) * (__pyx_v_y1 - __pyx_v_y0)));
  goto __pyx_L0;

  /* "bpf4/core.pyx":179
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_expon(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         double exp = self.exp
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":194
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_exponm(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         double exp = self.exp
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_exponm(__pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self, double __pyx_v_x, double __pyx_v_x0, double __pyx_v_y0, double __pyx_v_x1, double __pyx_v_y1) {
  double __pyx_v_exp;
  double __pyx_v_dx;
  double __pyx_v_x1x0;
  CYTHON_UNUSED int __pyx_v_i;
  double __pyx_r;
  double __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;

  /* "bpf4/core.pyx":196
 * cdef inline double intrp_exponm(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 *     cdef:
 *         double exp = self.exp             # <<<<<<<<<<<<<<
 *         double dx
 *         double x1x0 = x1 - x0
 */
  __pyx_t_1 = __pyx_v_self->exp;
  __pyx_v_exp = __pyx_t_1;

  /* "bpf4/core.pyx":198
 *         double exp = self.exp
 *         double dx
 *         double x1x0 = x1 - x0             # <<<<<<<<<<<<<<
 *         int i
 *     if y1 < y0:
 */
  __pyx_v_x1x0 = (__pyx_v_x1 - __pyx_v_x0);

  /* "bpf4/core.pyx":200
 *         double x1x0 = x1 - x0
 *         int i
 *     if y1 < y0:             # <<<<<<<<<<<<<<
 *         exp = 1/exp
 *     if self.numiter > 1:
 */
  __pyx_t_2 = ((__pyx_v_y1 < __pyx_v_y0) != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":201
 *         int i
 *     if y1 < y0:
 *         exp = 1/exp             # <<<<<<<<<<<<<<
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):
 */
    __pyx_v_exp = (1.0 / __pyx_v_exp);

    /* "bpf4/core.pyx":200
 *         double x1x0 = x1 - x0
 *         int i
 *     if y1 < y0:             # <<<<<<<<<<<<<<
 *         exp = 1/exp
 *     if self.numiter > 1:
 */
  }

  /* "bpf4/core.pyx":202
 *     if y1 < y0:
 *         exp = 1/exp
 *     if self.numiter > 1:             # <<<<<<<<<<<<<<
 *         for i in range(self.numiter - 1):
 *             dx = (x - x0) / x1x0
 */
  __pyx_t_2 = ((__pyx_v_self->numiter > 1) != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":203
 *         exp = 1/exp
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):             # <<<<<<<<<<<<<<
 *             dx = (x - x0) / x1x0
 *             x = x0 + pow(dx, exp) * x1x0
 */
    __pyx_t_3 = (__pyx_v_self->numiter - 1);
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "bpf4/core.pyx":204
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):
 *             dx = (x - x0) / x1x0             # <<<<<<<<<<<<<<
 *             x = x0 + pow(dx, exp) * x1x0
 *     dx = (x - x0) / x1x0
 */
      __pyx_v_dx = ((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0);

      /* "bpf4/core.pyx":205
 *         for i in range(self.numiter - 1):
 *             dx = (x - x0) / x1x0
 *             x = x0 + pow(dx, exp) * x1x0             # <<<<<<<<<<<<<<
 *     dx = (x - x0) / x1x0
 *     return y0 + pow(dx, exp) * (y1 - y0)
 */
      __pyx_v_x = (__pyx_v_x0 + (pow(__pyx_v_dx, __pyx_v_exp) * __pyx_v_x1x0));
    }

    /* "bpf4/core.pyx":202
 *     if y1 < y0:
 *         exp = 1/exp
 *     if self.numiter > 1:             # <<<<<<<<<<<<<<
 *         for i in range(self.numiter - 1):
 *             dx = (x - x0) / x1x0
 */
  }

  /* "bpf4/core.pyx":206
 *             dx = (x - x0) / x1x0
 *             x = x0 + pow(dx, exp) * x1x0
 *     dx = (x - x0) / x1x0             # <<<<<<<<<<<<<<
 *     return y0 + pow(dx, exp) * (y1 - y0)
 * 
 */
  __pyx_v_dx = ((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0);

  /* "bpf4/core.pyx":207
 *             x = x0 + pow(dx, exp) * x1x0
 *     dx = (x - x0) / x1x0
 *     return y0 + pow(dx, exp) * (y1 - y0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_y0 + (pow(__pyx_v_dx, __pyx_v_exp) * (__pyx_v_y1 - __pyx_v_y0)));
  goto __pyx_L0;

  /* "bpf4/core.pyx":194
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_exponm(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         double exp = self.exp
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":211
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_smooth(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     #define SMOOTHSTEP(x) (x) * (x) * (3 - 2 * x)
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_smooth(__pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self, double __pyx_v_x, double __pyx_v_x0, double __pyx_v_y0, double __pyx_v_x1, double __pyx_v_y1) {
  double __pyx_v_x1x0;
  double __pyx_v_v;
  CYTHON_UNUSED int __pyx_v_i;
  double __pyx_r;
  int __pyx_t_1;
  long __pyx_t_2;
  long __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":221
 *     """
 *     cdef:
 *         double x1x0 = x1 - x0             # <<<<<<<<<<<<<<
 *         double v
 *         int i
 */
  __pyx_v_x1x0 = (__pyx_v_x1 - __pyx_v_x0);

  /* "bpf4/core.pyx":225
 *         int i
 * 
 *     if self.numiter > 1:             # <<<<<<<<<<<<<<
 *         for i in range(self.numiter - 1):
 *             v = (x - x0) / x1x0
 */
  __pyx_t_1 = ((__pyx_v_self->numiter > 1) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":226
 * 
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):             # <<<<<<<<<<<<<<
 *             v = (x - x0) / x1x0
 *             v = v*v*(3 - 2*v)
 */
    __pyx_t_2 = (__pyx_v_self->numiter - 1);
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "bpf4/core.pyx":227
 *     if self.numiter > 1:
 *         for i in range(self.numiter - 1):
 *             v = (x - x0) / x1x0             # <<<<<<<<<<<<<<
 *             v = v*v*(3 - 2*v)
 *             x = x0 + x1x0 * v
 */
      __pyx_v_v = ((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0);

      /* "bpf4/core.pyx":228
 *         for i in range(self.numiter - 1):
 *             v = (x - x0) / x1x0
 *             v = v*v*(3 - 2*v)             # <<<<<<<<<<<<<<
 *             x = x0 + x1x0 * v
 *     v = (x - x0) / x1x0
 */
      __pyx_v_v = ((__pyx_v_v * __pyx_v_v) * (3.0 - (2.0 * __pyx_v_v)));

      /* "bpf4/core.pyx":229
 *             v = (x - x0) / x1x0
 *             v = v*v*(3 - 2*v)
 *             x = x0 + x1x0 * v             # <<<<<<<<<<<<<<
 *     v = (x - x0) / x1x0
 *     v = v*v*(3 - 2*v)
 */
      __pyx_v_x = (__pyx_v_x0 + (__pyx_v_x1x0 * __pyx_v_v));
    }

    /* "bpf4/core.pyx":225
 *         int i
 * 
 *     if self.numiter > 1:             # <<<<<<<<<<<<<<
 *         for i in range(self.numiter - 1):
 *             v = (x - x0) / x1x0
 */
  }

  /* "bpf4/core.pyx":230
 *             v = v*v*(3 - 2*v)
 *             x = x0 + x1x0 * v
 *     v = (x - x0) / x1x0             # <<<<<<<<<<<<<<
 *     v = v*v*(3 - 2*v)
 *     return y0 + (y1 - y0) * v
 */
  __pyx_v_v = ((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0);

  /* "bpf4/core.pyx":231
 *             x = x0 + x1x0 * v
 *     v = (x - x0) / x1x0
 *     v = v*v*(3 - 2*v)             # <<<<<<<<<<<<<<
 *     return y0 + (y1 - y0) * v
 * 
 */
  __pyx_v_v = ((__pyx_v_v * __pyx_v_v) * (3.0 - (2.0 * __pyx_v_v)));

  /* "bpf4/core.pyx":232
 *     v = (x - x0) / x1x0
 *     v = v*v*(3 - 2*v)
 *     return y0 + (y1 - y0) * v             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
  __pyx_r = (__pyx_v_y0 + ((__pyx_v_y1 - __pyx_v_y0) * __pyx_v_v));
  goto __pyx_L0;

  /* "bpf4/core.pyx":211
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_smooth(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     #define SMOOTHSTEP(x) (x) * (x) * (3 - 2 * x)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":235
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_smoother(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         double x1x0 = x1 - x0
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core_intrp_smoother(CYTHON_UNUSED __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self, double __pyx_v_x, double __pyx_v_x0, double __pyx_v_y0, double __pyx_v_x1, double __pyx_v_y1) {
  double __pyx_v_x1x0;
  double __pyx_v_v;
  double __pyx_r;

  /* "bpf4/core.pyx":237
 * cdef inline double intrp_smoother(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 *     cdef:
 *         double x1x0 = x1 - x0             # <<<<<<<<<<<<<<
 *         double v
 *     # x * x * x * (x * (x * 6 - 15) + 10);
 */
  __pyx_v_x1x0 = (__pyx_v_x1 - __pyx_v_x0);

  /* "bpf4/core.pyx":240
 *         double v
 *     # x * x * x * (x * (x * 6 - 15) + 10);
 *     v = (x - x0) / x1x0             # <<<<<<<<<<<<<<
 *     v = v*v*v*(v*(v*6 - 15) + 10)
 *     return y0 + (y1 - y0) * v
 */
  __pyx_v_v = ((__pyx_v_x - __pyx_v_x0) / __pyx_v_x1x0);

  /* "bpf4/core.pyx":241
 *     # x * x * x * (x * (x * 6 - 15) + 10);
 *     v = (x - x0) / x1x0
 *     v = v*v*v*(v*(v*6 - 15) + 10)             # <<<<<<<<<<<<<<
 *     return y0 + (y1 - y0) * v
 * 
 */
  __pyx_v_v = (((__pyx_v_v * __pyx_v_v) * __pyx_v_v) * ((__pyx_v_v * ((__pyx_v_v * 6.0) - 15.0)) + 10.0));

  /* "bpf4/core.pyx":242
 *     v = (x - x0) / x1x0
 *     v = v*v*v*(v*(v*6 - 15) + 10)
 *     return y0 + (y1 - y0) * v             # <<<<<<<<<<<<<<
 * 
 * # ------------------------------------------------------------------------------------------------
 */
  __pyx_r = (__pyx_v_y0 + ((__pyx_v_y1 - __pyx_v_y0) * __pyx_v_v));
  goto __pyx_L0;

  /* "bpf4/core.pyx":235
 * 
 * @cython.cdivision(True)
 * cdef inline double intrp_smoother(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         double x1x0 = x1 - x0
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":247
 * 
 * @cython.cdivision(True)
 * cdef inline double _integr_trapz(double *xs, int xs_size, double dx) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     area of a trapezium (trapezoid)
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core__integr_trapz(double *__pyx_v_xs, int __pyx_v_xs_size, double __pyx_v_dx) {
  int __pyx_v_i;
  double __pyx_v_x0;
  double __pyx_v_x1;
  double __pyx_v_accum;
  double __pyx_v_r;
  double __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":278
 *     cdef int i
 *     cdef double x0, x1, accum
 *     cdef double r = 0.5 * dx             # <<<<<<<<<<<<<<
 *     x0 = xs[0]
 *     accum = 0
 */
  __pyx_v_r = (0.5 * __pyx_v_dx);

  /* "bpf4/core.pyx":279
 *     cdef double x0, x1, accum
 *     cdef double r = 0.5 * dx
 *     x0 = xs[0]             # <<<<<<<<<<<<<<
 *     accum = 0
 *     for i in range(1, xs_size):
 */
  __pyx_v_x0 = (__pyx_v_xs[0]);

  /* "bpf4/core.pyx":280
 *     cdef double r = 0.5 * dx
 *     x0 = xs[0]
 *     accum = 0             # <<<<<<<<<<<<<<
 *     for i in range(1, xs_size):
 *         x1 = xs[i]
 */
  __pyx_v_accum = 0.0;

  /* "bpf4/core.pyx":281
 *     x0 = xs[0]
 *     accum = 0
 *     for i in range(1, xs_size):             # <<<<<<<<<<<<<<
 *         x1 = xs[i]
 *         accum += (x0 + x1) * r
 */
  __pyx_t_1 = __pyx_v_xs_size;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 1; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":282
 *     accum = 0
 *     for i in range(1, xs_size):
 *         x1 = xs[i]             # <<<<<<<<<<<<<<
 *         accum += (x0 + x1) * r
 *         x0 = x1
 */
    __pyx_v_x1 = (__pyx_v_xs[__pyx_v_i]);

    /* "bpf4/core.pyx":283
 *     for i in range(1, xs_size):
 *         x1 = xs[i]
 *         accum += (x0 + x1) * r             # <<<<<<<<<<<<<<
 *         x0 = x1
 *     return accum
 */
    __pyx_v_accum = (__pyx_v_accum + ((__pyx_v_x0 + __pyx_v_x1) * __pyx_v_r));

    /* "bpf4/core.pyx":284
 *         x1 = xs[i]
 *         accum += (x0 + x1) * r
 *         x0 = x1             # <<<<<<<<<<<<<<
 *     return accum
 * 
 */
    __pyx_v_x0 = __pyx_v_x1;
  }

  /* "bpf4/core.pyx":285
 *         accum += (x0 + x1) * r
 *         x0 = x1
 *     return accum             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
  __pyx_r = __pyx_v_accum;
  goto __pyx_L0;

  /* "bpf4/core.pyx":247
 * 
 * @cython.cdivision(True)
 * cdef inline double _integr_trapz(double *xs, int xs_size, double dx) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     area of a trapezium (trapezoid)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":288
 * 
 * @cython.cdivision(True)
 * cdef inline double _integr_trapz_between(double *xs, int xs_size, double dx, double offset, double a, double b) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     integrate sampled values `xs`, spaced at `dx` with an offset of `offset` in the range
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core__integr_trapz_between(double *__pyx_v_xs, int __pyx_v_xs_size, double __pyx_v_dx, double __pyx_v_offset, double __pyx_v_a, double __pyx_v_b) {
  int __pyx_v_i;
  double __pyx_v_x0;
  double __pyx_v_x1;
  double __pyx_v_accum;
  double __pyx_v_r;
  int __pyx_v_i0;
  int __pyx_v_i1;
  double __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":298
 *     cdef int i
 *     cdef double x0, x1, accum
 *     cdef double r = 0.5 * dx             # <<<<<<<<<<<<<<
 *     cdef int i0 = <int>((a - offset) / dx)
 *     cdef int i1 = <int>((b - offset) / dx) + 1
 */
  __pyx_v_r = (0.5 * __pyx_v_dx);

  /* "bpf4/core.pyx":299
 *     cdef double x0, x1, accum
 *     cdef double r = 0.5 * dx
 *     cdef int i0 = <int>((a - offset) / dx)             # <<<<<<<<<<<<<<
 *     cdef int i1 = <int>((b - offset) / dx) + 1
 *     accum = 0
 */
  __pyx_v_i0 = ((int)((__pyx_v_a - __pyx_v_offset) / __pyx_v_dx));

  /* "bpf4/core.pyx":300
 *     cdef double r = 0.5 * dx
 *     cdef int i0 = <int>((a - offset) / dx)
 *     cdef int i1 = <int>((b - offset) / dx) + 1             # <<<<<<<<<<<<<<
 *     accum = 0
 *     if i1 > xs_size:
 */
  __pyx_v_i1 = (((int)((__pyx_v_b - __pyx_v_offset) / __pyx_v_dx)) + 1);

  /* "bpf4/core.pyx":301
 *     cdef int i0 = <int>((a - offset) / dx)
 *     cdef int i1 = <int>((b - offset) / dx) + 1
 *     accum = 0             # <<<<<<<<<<<<<<
 *     if i1 > xs_size:
 *         i1 = xs_size
 */
  __pyx_v_accum = 0.0;

  /* "bpf4/core.pyx":302
 *     cdef int i1 = <int>((b - offset) / dx) + 1
 *     accum = 0
 *     if i1 > xs_size:             # <<<<<<<<<<<<<<
 *         i1 = xs_size
 *     x0 = xs[i0]
 */
  __pyx_t_1 = ((__pyx_v_i1 > __pyx_v_xs_size) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":303
 *     accum = 0
 *     if i1 > xs_size:
 *         i1 = xs_size             # <<<<<<<<<<<<<<
 *     x0 = xs[i0]
 *     for i in range(i0+1, i1):
 */
    __pyx_v_i1 = __pyx_v_xs_size;

    /* "bpf4/core.pyx":302
 *     cdef int i1 = <int>((b - offset) / dx) + 1
 *     accum = 0
 *     if i1 > xs_size:             # <<<<<<<<<<<<<<
 *         i1 = xs_size
 *     x0 = xs[i0]
 */
  }

  /* "bpf4/core.pyx":304
 *     if i1 > xs_size:
 *         i1 = xs_size
 *     x0 = xs[i0]             # <<<<<<<<<<<<<<
 *     for i in range(i0+1, i1):
 *         x1 = xs[i]
 */
  __pyx_v_x0 = (__pyx_v_xs[__pyx_v_i0]);

  /* "bpf4/core.pyx":305
 *         i1 = xs_size
 *     x0 = xs[i0]
 *     for i in range(i0+1, i1):             # <<<<<<<<<<<<<<
 *         x1 = xs[i]
 *         accum += (x0 + x1) * r
 */
  __pyx_t_2 = __pyx_v_i1;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = (__pyx_v_i0 + 1); __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "bpf4/core.pyx":306
 *     x0 = xs[i0]
 *     for i in range(i0+1, i1):
 *         x1 = xs[i]             # <<<<<<<<<<<<<<
 *         accum += (x0 + x1) * r
 *         x0 = x1
 */
    __pyx_v_x1 = (__pyx_v_xs[__pyx_v_i]);

    /* "bpf4/core.pyx":307
 *     for i in range(i0+1, i1):
 *         x1 = xs[i]
 *         accum += (x0 + x1) * r             # <<<<<<<<<<<<<<
 *         x0 = x1
 *     return accum
 */
    __pyx_v_accum = (__pyx_v_accum + ((__pyx_v_x0 + __pyx_v_x1) * __pyx_v_r));

    /* "bpf4/core.pyx":308
 *         x1 = xs[i]
 *         accum += (x0 + x1) * r
 *         x0 = x1             # <<<<<<<<<<<<<<
 *     return accum
 * 
 */
    __pyx_v_x0 = __pyx_v_x1;
  }

  /* "bpf4/core.pyx":309
 *         accum += (x0 + x1) * r
 *         x0 = x1
 *     return accum             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
  __pyx_r = __pyx_v_accum;
  goto __pyx_L0;

  /* "bpf4/core.pyx":288
 * 
 * @cython.cdivision(True)
 * cdef inline double _integr_trapz_between(double *xs, int xs_size, double dx, double offset, double a, double b) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     integrate sampled values `xs`, spaced at `dx` with an offset of `offset` in the range
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":312
 * 
 * @cython.cdivision(True)
 * cdef inline double _integr_trapz_between_exact(double *xs, int xs_size, double dx, double offset, double a, double b) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     integrate sampled values `xs`, spaced at `dx` with an offset of `offset` in the range
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core__integr_trapz_between_exact(double *__pyx_v_xs, int __pyx_v_xs_size, double __pyx_v_dx, double __pyx_v_offset, double __pyx_v_a, double __pyx_v_b) {
  int __pyx_v_i;
  double __pyx_v_x0;
  double __pyx_v_x1;
  double __pyx_v_accum;
  double __pyx_v_y;
  double __pyx_v_r;
  int __pyx_v_i0;
  int __pyx_v_i1;
  double __pyx_v_rest_a;
  double __pyx_v_rest_b;
  double __pyx_v_y0;
  double __pyx_v_y1;
  double __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;

  /* "bpf4/core.pyx":319
 *     cdef int i
 *     cdef double x0, x1, accum, y
 *     cdef double r = 0.5 * dx             # <<<<<<<<<<<<<<
 *     cdef int i0 = <int>((a - offset) / dx + 0.999999999)
 *     cdef int i1 = <int>((b - offset) / dx) + 1
 */
  __pyx_v_r = (0.5 * __pyx_v_dx);

  /* "bpf4/core.pyx":320
 *     cdef double x0, x1, accum, y
 *     cdef double r = 0.5 * dx
 *     cdef int i0 = <int>((a - offset) / dx + 0.999999999)             # <<<<<<<<<<<<<<
 *     cdef int i1 = <int>((b - offset) / dx) + 1
 *     cdef double rest_a = ((a - offset) % dx) / dx
 */
  __pyx_v_i0 = ((int)(((__pyx_v_a - __pyx_v_offset) / __pyx_v_dx) + 0.999999999));

  /* "bpf4/core.pyx":321
 *     cdef double r = 0.5 * dx
 *     cdef int i0 = <int>((a - offset) / dx + 0.999999999)
 *     cdef int i1 = <int>((b - offset) / dx) + 1             # <<<<<<<<<<<<<<
 *     cdef double rest_a = ((a - offset) % dx) / dx
 *     cdef double rest_b = ((b - offset) % dx) / dx
 */
  __pyx_v_i1 = (((int)((__pyx_v_b - __pyx_v_offset) / __pyx_v_dx)) + 1);

  /* "bpf4/core.pyx":322
 *     cdef int i0 = <int>((a - offset) / dx + 0.999999999)
 *     cdef int i1 = <int>((b - offset) / dx) + 1
 *     cdef double rest_a = ((a - offset) % dx) / dx             # <<<<<<<<<<<<<<
 *     cdef double rest_b = ((b - offset) % dx) / dx
 *     accum = 0
 */
  __pyx_v_rest_a = (fmod((__pyx_v_a - __pyx_v_offset), __pyx_v_dx) / __pyx_v_dx);

  /* "bpf4/core.pyx":323
 *     cdef int i1 = <int>((b - offset) / dx) + 1
 *     cdef double rest_a = ((a - offset) % dx) / dx
 *     cdef double rest_b = ((b - offset) % dx) / dx             # <<<<<<<<<<<<<<
 *     accum = 0
 *     if i1 > xs_size:
 */
  __pyx_v_rest_b = (fmod((__pyx_v_b - __pyx_v_offset), __pyx_v_dx) / __pyx_v_dx);

  /* "bpf4/core.pyx":324
 *     cdef double rest_a = ((a - offset) % dx) / dx
 *     cdef double rest_b = ((b - offset) % dx) / dx
 *     accum = 0             # <<<<<<<<<<<<<<
 *     if i1 > xs_size:
 *         i1 = xs_size
 */
  __pyx_v_accum = 0.0;

  /* "bpf4/core.pyx":325
 *     cdef double rest_b = ((b - offset) % dx) / dx
 *     accum = 0
 *     if i1 > xs_size:             # <<<<<<<<<<<<<<
 *         i1 = xs_size
 *     x0 = xs[i0]
 */
  __pyx_t_1 = ((__pyx_v_i1 > __pyx_v_xs_size) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":326
 *     accum = 0
 *     if i1 > xs_size:
 *         i1 = xs_size             # <<<<<<<<<<<<<<
 *     x0 = xs[i0]
 *     for i in range(i0+1, i1):
 */
    __pyx_v_i1 = __pyx_v_xs_size;

    /* "bpf4/core.pyx":325
 *     cdef double rest_b = ((b - offset) % dx) / dx
 *     accum = 0
 *     if i1 > xs_size:             # <<<<<<<<<<<<<<
 *         i1 = xs_size
 *     x0 = xs[i0]
 */
  }

  /* "bpf4/core.pyx":327
 *     if i1 > xs_size:
 *         i1 = xs_size
 *     x0 = xs[i0]             # <<<<<<<<<<<<<<
 *     for i in range(i0+1, i1):
 *         x1 = xs[i]
 */
  __pyx_v_x0 = (__pyx_v_xs[__pyx_v_i0]);

  /* "bpf4/core.pyx":328
 *         i1 = xs_size
 *     x0 = xs[i0]
 *     for i in range(i0+1, i1):             # <<<<<<<<<<<<<<
 *         x1 = xs[i]
 *         accum += (x0 + x1) * r
 */
  __pyx_t_2 = __pyx_v_i1;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = (__pyx_v_i0 + 1); __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "bpf4/core.pyx":329
 *     x0 = xs[i0]
 *     for i in range(i0+1, i1):
 *         x1 = xs[i]             # <<<<<<<<<<<<<<
 *         accum += (x0 + x1) * r
 *         x0 = x1
 */
    __pyx_v_x1 = (__pyx_v_xs[__pyx_v_i]);

    /* "bpf4/core.pyx":330
 *     for i in range(i0+1, i1):
 *         x1 = xs[i]
 *         accum += (x0 + x1) * r             # <<<<<<<<<<<<<<
 *         x0 = x1
 *     if rest_a > 0 and i0 > 0:
 */
    __pyx_v_accum = (__pyx_v_accum + ((__pyx_v_x0 + __pyx_v_x1) * __pyx_v_r));

    /* "bpf4/core.pyx":331
 *         x1 = xs[i]
 *         accum += (x0 + x1) * r
 *         x0 = x1             # <<<<<<<<<<<<<<
 *     if rest_a > 0 and i0 > 0:
 *         y0 = xs[i0-1]
 */
    __pyx_v_x0 = __pyx_v_x1;
  }

  /* "bpf4/core.pyx":332
 *         accum += (x0 + x1) * r
 *         x0 = x1
 *     if rest_a > 0 and i0 > 0:             # <<<<<<<<<<<<<<
 *         y0 = xs[i0-1]
 *         y1 = xs[i0]
 */
  __pyx_t_5 = ((__pyx_v_rest_a > 0.0) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_i0 > 0) != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":333
 *         x0 = x1
 *     if rest_a > 0 and i0 > 0:
 *         y0 = xs[i0-1]             # <<<<<<<<<<<<<<
 *         y1 = xs[i0]
 *         y = y0 + (y1-y0) * rest_a
 */
    __pyx_v_y0 = (__pyx_v_xs[(__pyx_v_i0 - 1)]);

    /* "bpf4/core.pyx":334
 *     if rest_a > 0 and i0 > 0:
 *         y0 = xs[i0-1]
 *         y1 = xs[i0]             # <<<<<<<<<<<<<<
 *         y = y0 + (y1-y0) * rest_a
 *         accum += (y + y1) * 0.5 * dx * (1 - rest_a)
 */
    __pyx_v_y1 = (__pyx_v_xs[__pyx_v_i0]);

    /* "bpf4/core.pyx":335
 *         y0 = xs[i0-1]
 *         y1 = xs[i0]
 *         y = y0 + (y1-y0) * rest_a             # <<<<<<<<<<<<<<
 *         accum += (y + y1) * 0.5 * dx * (1 - rest_a)
 *     if rest_b > 0 and (i1 + 1) < xs_size:
 */
    __pyx_v_y = (__pyx_v_y0 + ((__pyx_v_y1 - __pyx_v_y0) * __pyx_v_rest_a));

    /* "bpf4/core.pyx":336
 *         y1 = xs[i0]
 *         y = y0 + (y1-y0) * rest_a
 *         accum += (y + y1) * 0.5 * dx * (1 - rest_a)             # <<<<<<<<<<<<<<
 *     if rest_b > 0 and (i1 + 1) < xs_size:
 *         y0 = xs[i1]
 */
    __pyx_v_accum = (__pyx_v_accum + ((((__pyx_v_y + __pyx_v_y1) * 0.5) * __pyx_v_dx) * (1.0 - __pyx_v_rest_a)));

    /* "bpf4/core.pyx":332
 *         accum += (x0 + x1) * r
 *         x0 = x1
 *     if rest_a > 0 and i0 > 0:             # <<<<<<<<<<<<<<
 *         y0 = xs[i0-1]
 *         y1 = xs[i0]
 */
  }

  /* "bpf4/core.pyx":337
 *         y = y0 + (y1-y0) * rest_a
 *         accum += (y + y1) * 0.5 * dx * (1 - rest_a)
 *     if rest_b > 0 and (i1 + 1) < xs_size:             # <<<<<<<<<<<<<<
 *         y0 = xs[i1]
 *         y1 = xs[i1+1]
 */
  __pyx_t_5 = ((__pyx_v_rest_b > 0.0) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_5 = (((__pyx_v_i1 + 1) < __pyx_v_xs_size) != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":338
 *         accum += (y + y1) * 0.5 * dx * (1 - rest_a)
 *     if rest_b > 0 and (i1 + 1) < xs_size:
 *         y0 = xs[i1]             # <<<<<<<<<<<<<<
 *         y1 = xs[i1+1]
 *         y = y0 + (y1-y0) * rest_a
 */
    __pyx_v_y0 = (__pyx_v_xs[__pyx_v_i1]);

    /* "bpf4/core.pyx":339
 *     if rest_b > 0 and (i1 + 1) < xs_size:
 *         y0 = xs[i1]
 *         y1 = xs[i1+1]             # <<<<<<<<<<<<<<
 *         y = y0 + (y1-y0) * rest_a
 *         accum += (y0 + y) * 0.5 * dx * rest_b
 */
    __pyx_v_y1 = (__pyx_v_xs[(__pyx_v_i1 + 1)]);

    /* "bpf4/core.pyx":340
 *         y0 = xs[i1]
 *         y1 = xs[i1+1]
 *         y = y0 + (y1-y0) * rest_a             # <<<<<<<<<<<<<<
 *         accum += (y0 + y) * 0.5 * dx * rest_b
 *     return accum
 */
    __pyx_v_y = (__pyx_v_y0 + ((__pyx_v_y1 - __pyx_v_y0) * __pyx_v_rest_a));

    /* "bpf4/core.pyx":341
 *         y1 = xs[i1+1]
 *         y = y0 + (y1-y0) * rest_a
 *         accum += (y0 + y) * 0.5 * dx * rest_b             # <<<<<<<<<<<<<<
 *     return accum
 * 
 */
    __pyx_v_accum = (__pyx_v_accum + ((((__pyx_v_y0 + __pyx_v_y) * 0.5) * __pyx_v_dx) * __pyx_v_rest_b));

    /* "bpf4/core.pyx":337
 *         y = y0 + (y1-y0) * rest_a
 *         accum += (y + y1) * 0.5 * dx * (1 - rest_a)
 *     if rest_b > 0 and (i1 + 1) < xs_size:             # <<<<<<<<<<<<<<
 *         y0 = xs[i1]
 *         y1 = xs[i1+1]
 */
  }

  /* "bpf4/core.pyx":342
 *         y = y0 + (y1-y0) * rest_a
 *         accum += (y0 + y) * 0.5 * dx * rest_b
 *     return accum             # <<<<<<<<<<<<<<
 * 
 * cdef inline double _clip(double x, double x0, double x1) nogil:
 */
  __pyx_r = __pyx_v_accum;
  goto __pyx_L0;

  /* "bpf4/core.pyx":312
 * 
 * @cython.cdivision(True)
 * cdef inline double _integr_trapz_between_exact(double *xs, int xs_size, double dx, double offset, double a, double b) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     integrate sampled values `xs`, spaced at `dx` with an offset of `offset` in the range
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":344
 *     return accum
 * 
 * cdef inline double _clip(double x, double x0, double x1) nogil:             # <<<<<<<<<<<<<<
 *     return x1 if x > x1 else x0 if x < x0 else x
 * 
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core__clip(double __pyx_v_x, double __pyx_v_x0, double __pyx_v_x1) {
  double __pyx_r;
  double __pyx_t_1;
  double __pyx_t_2;

  /* "bpf4/core.pyx":345
 * 
 * cdef inline double _clip(double x, double x0, double x1) nogil:
 *     return x1 if x > x1 else x0 if x < x0 else x             # <<<<<<<<<<<<<<
 * 
 * cdef inline double _ntodx(size_t n, double x0, double x1):
 */
  if (((__pyx_v_x > __pyx_v_x1) != 0)) {
    __pyx_t_1 = __pyx_v_x1;
  } else {
    if (((__pyx_v_x < __pyx_v_x0) != 0)) {
      __pyx_t_2 = __pyx_v_x0;
    } else {
      __pyx_t_2 = __pyx_v_x;
    }
    __pyx_t_1 = __pyx_t_2;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "bpf4/core.pyx":344
 *     return accum
 * 
 * cdef inline double _clip(double x, double x0, double x1) nogil:             # <<<<<<<<<<<<<<
 *     return x1 if x > x1 else x0 if x < x0 else x
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":347
 *     return x1 if x > x1 else x0 if x < x0 else x
 * 
 * cdef inline double _ntodx(size_t n, double x0, double x1):             # <<<<<<<<<<<<<<
 *     return (x1 - x0) / (n - 1)
 * 
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core__ntodx(size_t __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  size_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ntodx", 0);

  /* "bpf4/core.pyx":348
 * 
 * cdef inline double _ntodx(size_t n, double x0, double x1):
 *     return (x1 - x0) / (n - 1)             # <<<<<<<<<<<<<<
 * 
 * cdef inline size_t _dxton(double dx, double x0, double x1):
 */
  __pyx_t_1 = (__pyx_v_x1 - __pyx_v_x0);
  __pyx_t_2 = (__pyx_v_n - 1);
  if (unlikely(__pyx_t_2 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 348, __pyx_L1_error)
  }
  __pyx_r = (__pyx_t_1 / ((double)__pyx_t_2));
  goto __pyx_L0;

  /* "bpf4/core.pyx":347
 *     return x1 if x > x1 else x0 if x < x0 else x
 * 
 * cdef inline double _ntodx(size_t n, double x0, double x1):             # <<<<<<<<<<<<<<
 *     return (x1 - x0) / (n - 1)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("bpf4.core._ntodx", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":350
 *     return (x1 - x0) / (n - 1)
 * 
 * cdef inline size_t _dxton(double dx, double x0, double x1):             # <<<<<<<<<<<<<<
 *     return <size_t>round((x1-x0)/dx+1)
 * 
 */

static CYTHON_INLINE size_t __pyx_f_4bpf4_4core__dxton(double __pyx_v_dx, double __pyx_v_x0, double __pyx_v_x1) {
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_dxton", 0);

  /* "bpf4/core.pyx":351
 * 
 * cdef inline size_t _dxton(double dx, double x0, double x1):
 *     return <size_t>round((x1-x0)/dx+1)             # <<<<<<<<<<<<<<
 * 
 * cdef double _a4 = 442.0
 */
  __pyx_t_1 = (__pyx_v_x1 - __pyx_v_x0);
  if (unlikely(__pyx_v_dx == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 351, __pyx_L1_error)
  }
  __pyx_t_2 = PyFloat_FromDouble(((__pyx_t_1 / __pyx_v_dx) + 1.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_round, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = ((size_t)__pyx_t_4);
  goto __pyx_L0;

  /* "bpf4/core.pyx":350
 *     return (x1 - x0) / (n - 1)
 * 
 * cdef inline size_t _dxton(double dx, double x0, double x1):             # <<<<<<<<<<<<<<
 *     return <size_t>round((x1-x0)/dx+1)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("bpf4.core._dxton", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":357
 * 
 * 
 * def setA4(double freq):             # <<<<<<<<<<<<<<
 *     """
 *     Set the reference freq used
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_1setA4(PyObject *__pyx_self, PyObject *__pyx_arg_freq); /*proto*/
static char __pyx_doc_4bpf4_4core_setA4[] = "setA4(double freq)\n\n    Set the reference freq used\n\n    Args:\n        freq (float): the reference frequency for A4\n    ";
static PyMethodDef __pyx_mdef_4bpf4_4core_1setA4 = {"setA4", (PyCFunction)__pyx_pw_4bpf4_4core_1setA4, METH_O, __pyx_doc_4bpf4_4core_setA4};
static PyObject *__pyx_pw_4bpf4_4core_1setA4(PyObject *__pyx_self, PyObject *__pyx_arg_freq) {
  double __pyx_v_freq;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setA4 (wrapper)", 0);
  assert(__pyx_arg_freq); {
    __pyx_v_freq = __pyx_PyFloat_AsDouble(__pyx_arg_freq); if (unlikely((__pyx_v_freq == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 357, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.setA4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_setA4(__pyx_self, ((double)__pyx_v_freq));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_setA4(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_freq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setA4", 0);

  /* "bpf4/core.pyx":365
 *     """
 *     global _a4
 *     _a4 = freq             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_4bpf4_4core__a4 = __pyx_v_freq;

  /* "bpf4/core.pyx":357
 * 
 * 
 * def setA4(double freq):             # <<<<<<<<<<<<<<
 *     """
 *     Set the reference freq used
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":369
 * 
 * @cython.cdivision(True)
 * cdef double m2f(double midinote) nogil:             # <<<<<<<<<<<<<<
 *     global _a4
 *     if 0.0 <= midinote:
 */

static double __pyx_f_4bpf4_4core_m2f(double __pyx_v_midinote) {
  double __pyx_r;
  int __pyx_t_1;

  /* "bpf4/core.pyx":371
 * cdef double m2f(double midinote) nogil:
 *     global _a4
 *     if 0.0 <= midinote:             # <<<<<<<<<<<<<<
 *         return _a4 * pow(2.0, (midinote - 69.0) / 12.0)
 *     return 0.
 */
  __pyx_t_1 = ((0.0 <= __pyx_v_midinote) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":372
 *     global _a4
 *     if 0.0 <= midinote:
 *         return _a4 * pow(2.0, (midinote - 69.0) / 12.0)             # <<<<<<<<<<<<<<
 *     return 0.
 * 
 */
    __pyx_r = (__pyx_v_4bpf4_4core__a4 * pow(2.0, ((__pyx_v_midinote - 69.0) / 12.0)));
    goto __pyx_L0;

    /* "bpf4/core.pyx":371
 * cdef double m2f(double midinote) nogil:
 *     global _a4
 *     if 0.0 <= midinote:             # <<<<<<<<<<<<<<
 *         return _a4 * pow(2.0, (midinote - 69.0) / 12.0)
 *     return 0.
 */
  }

  /* "bpf4/core.pyx":373
 *     if 0.0 <= midinote:
 *         return _a4 * pow(2.0, (midinote - 69.0) / 12.0)
 *     return 0.             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
  __pyx_r = 0.;
  goto __pyx_L0;

  /* "bpf4/core.pyx":369
 * 
 * @cython.cdivision(True)
 * cdef double m2f(double midinote) nogil:             # <<<<<<<<<<<<<<
 *     global _a4
 *     if 0.0 <= midinote:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":376
 * 
 * @cython.cdivision(True)
 * cdef double f2m(double freq) nogil:             # <<<<<<<<<<<<<<
 *     global _a4
 *     if 8.2129616379875419 < freq:    # this is the freq. of midi 0
 */

static double __pyx_f_4bpf4_4core_f2m(double __pyx_v_freq) {
  double __pyx_r;
  int __pyx_t_1;

  /* "bpf4/core.pyx":378
 * cdef double f2m(double freq) nogil:
 *     global _a4
 *     if 8.2129616379875419 < freq:    # this is the freq. of midi 0             # <<<<<<<<<<<<<<
 *         return 12 * (log(freq / _a4) / loge_2) + 69.0
 *     return 0
 */
  __pyx_t_1 = ((8.2129616379875419 < __pyx_v_freq) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":379
 *     global _a4
 *     if 8.2129616379875419 < freq:    # this is the freq. of midi 0
 *         return 12 * (log(freq / _a4) / loge_2) + 69.0             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
    __pyx_r = ((12.0 * (log((__pyx_v_freq / __pyx_v_4bpf4_4core__a4)) / 0.6931471805599453)) + 69.0);
    goto __pyx_L0;

    /* "bpf4/core.pyx":378
 * cdef double f2m(double freq) nogil:
 *     global _a4
 *     if 8.2129616379875419 < freq:    # this is the freq. of midi 0             # <<<<<<<<<<<<<<
 *         return 12 * (log(freq / _a4) / loge_2) + 69.0
 *     return 0
 */
  }

  /* "bpf4/core.pyx":380
 *     if 8.2129616379875419 < freq:    # this is the freq. of midi 0
 *         return 12 * (log(freq / _a4) / loge_2) + 69.0
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * # ---------------------------- TYPES
 */
  __pyx_r = 0.0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":376
 * 
 * @cython.cdivision(True)
 * cdef double f2m(double freq) nogil:             # <<<<<<<<<<<<<<
 *     global _a4
 *     if 8.2129616379875419 < freq:    # this is the freq. of midi 0
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":421
 * 
 * # InterpolFunc
 * cdef inline void InterpolFunc_init(InterpolFunc *self, t_func func, double exp, char *name, unsigned int needs_free):             # <<<<<<<<<<<<<<
 *     self.func = func
 *     self.exp = exp
 */

static CYTHON_INLINE void __pyx_f_4bpf4_4core_InterpolFunc_init(__pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self, __pyx_t_4bpf4_4core_t_func __pyx_v_func, double __pyx_v_exp, char *__pyx_v_name, unsigned int __pyx_v_needs_free) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("InterpolFunc_init", 0);

  /* "bpf4/core.pyx":422
 * # InterpolFunc
 * cdef inline void InterpolFunc_init(InterpolFunc *self, t_func func, double exp, char *name, unsigned int needs_free):
 *     self.func = func             # <<<<<<<<<<<<<<
 *     self.exp = exp
 *     self.numiter = 1
 */
  __pyx_v_self->func = __pyx_v_func;

  /* "bpf4/core.pyx":423
 * cdef inline void InterpolFunc_init(InterpolFunc *self, t_func func, double exp, char *name, unsigned int needs_free):
 *     self.func = func
 *     self.exp = exp             # <<<<<<<<<<<<<<
 *     self.numiter = 1
 *     self.mix = -1
 */
  __pyx_v_self->exp = __pyx_v_exp;

  /* "bpf4/core.pyx":424
 *     self.func = func
 *     self.exp = exp
 *     self.numiter = 1             # <<<<<<<<<<<<<<
 *     self.mix = -1
 *     self.blend_func = NULL
 */
  __pyx_v_self->numiter = 1;

  /* "bpf4/core.pyx":425
 *     self.exp = exp
 *     self.numiter = 1
 *     self.mix = -1             # <<<<<<<<<<<<<<
 *     self.blend_func = NULL
 *     self.name = name
 */
  __pyx_v_self->mix = -1.0;

  /* "bpf4/core.pyx":426
 *     self.numiter = 1
 *     self.mix = -1
 *     self.blend_func = NULL             # <<<<<<<<<<<<<<
 *     self.name = name
 *     self.needs_free = needs_free
 */
  __pyx_v_self->blend_func = NULL;

  /* "bpf4/core.pyx":427
 *     self.mix = -1
 *     self.blend_func = NULL
 *     self.name = name             # <<<<<<<<<<<<<<
 *     self.needs_free = needs_free
 * 
 */
  __pyx_v_self->name = __pyx_v_name;

  /* "bpf4/core.pyx":428
 *     self.blend_func = NULL
 *     self.name = name
 *     self.needs_free = needs_free             # <<<<<<<<<<<<<<
 * 
 * cdef inline InterpolFunc* InterpolFunc_new(t_func func, double exp, char *name, unsigned int needs_free):
 */
  __pyx_v_self->needs_free = __pyx_v_needs_free;

  /* "bpf4/core.pyx":421
 * 
 * # InterpolFunc
 * cdef inline void InterpolFunc_init(InterpolFunc *self, t_func func, double exp, char *name, unsigned int needs_free):             # <<<<<<<<<<<<<<
 *     self.func = func
 *     self.exp = exp
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":430
 *     self.needs_free = needs_free
 * 
 * cdef inline InterpolFunc* InterpolFunc_new(t_func func, double exp, char *name, unsigned int needs_free):             # <<<<<<<<<<<<<<
 *     cdef InterpolFunc* out
 *     out = <InterpolFunc *>malloc(sizeof(InterpolFunc))
 */

static CYTHON_INLINE __pyx_t_4bpf4_4core_InterpolFunc *__pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_t_4bpf4_4core_t_func __pyx_v_func, double __pyx_v_exp, char *__pyx_v_name, unsigned int __pyx_v_needs_free) {
  __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_out;
  __pyx_t_4bpf4_4core_InterpolFunc *__pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("InterpolFunc_new", 0);

  /* "bpf4/core.pyx":432
 * cdef inline InterpolFunc* InterpolFunc_new(t_func func, double exp, char *name, unsigned int needs_free):
 *     cdef InterpolFunc* out
 *     out = <InterpolFunc *>malloc(sizeof(InterpolFunc))             # <<<<<<<<<<<<<<
 *     InterpolFunc_init(out, func, exp, name, needs_free)
 *     return out
 */
  __pyx_v_out = ((__pyx_t_4bpf4_4core_InterpolFunc *)malloc((sizeof(__pyx_t_4bpf4_4core_InterpolFunc))));

  /* "bpf4/core.pyx":433
 *     cdef InterpolFunc* out
 *     out = <InterpolFunc *>malloc(sizeof(InterpolFunc))
 *     InterpolFunc_init(out, func, exp, name, needs_free)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  __pyx_f_4bpf4_4core_InterpolFunc_init(__pyx_v_out, __pyx_v_func, __pyx_v_exp, __pyx_v_name, __pyx_v_needs_free);

  /* "bpf4/core.pyx":434
 *     out = <InterpolFunc *>malloc(sizeof(InterpolFunc))
 *     InterpolFunc_init(out, func, exp, name, needs_free)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef inline InterpolFunc* InterpolFunc_new_blend_from_descr(str descr0, str descr1, double mix):
 */
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bpf4/core.pyx":430
 *     self.needs_free = needs_free
 * 
 * cdef inline InterpolFunc* InterpolFunc_new(t_func func, double exp, char *name, unsigned int needs_free):             # <<<<<<<<<<<<<<
 *     cdef InterpolFunc* out
 *     out = <InterpolFunc *>malloc(sizeof(InterpolFunc))
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":436
 *     return out
 * 
 * cdef inline InterpolFunc* InterpolFunc_new_blend_from_descr(str descr0, str descr1, double mix):             # <<<<<<<<<<<<<<
 *     cdef InterpolFunc* out = InterpolFunc_new_from_descriptor(descr0, 1)  # force new
 *     cdef InterpolFunc* blend = InterpolFunc_new_from_descriptor(descr1, 1)  # force new
 */

static CYTHON_INLINE __pyx_t_4bpf4_4core_InterpolFunc *__pyx_f_4bpf4_4core_InterpolFunc_new_blend_from_descr(PyObject *__pyx_v_descr0, PyObject *__pyx_v_descr1, double __pyx_v_mix) {
  __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_out;
  __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_blend;
  __pyx_t_4bpf4_4core_InterpolFunc *__pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_4bpf4_4core_InterpolFunc *__pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_InterpolFunc_new_from_descriptor __pyx_t_2;
  __Pyx_RefNannySetupContext("InterpolFunc_new_blend_from_descr", 0);

  /* "bpf4/core.pyx":437
 * 
 * cdef inline InterpolFunc* InterpolFunc_new_blend_from_descr(str descr0, str descr1, double mix):
 *     cdef InterpolFunc* out = InterpolFunc_new_from_descriptor(descr0, 1)  # force new             # <<<<<<<<<<<<<<
 *     cdef InterpolFunc* blend = InterpolFunc_new_from_descriptor(descr1, 1)  # force new
 *     out.blend_func = blend
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.forcenew = 1;
  __pyx_t_1 = __pyx_f_4bpf4_4core_InterpolFunc_new_from_descriptor(__pyx_v_descr0, &__pyx_t_2); 
  __pyx_v_out = __pyx_t_1;

  /* "bpf4/core.pyx":438
 * cdef inline InterpolFunc* InterpolFunc_new_blend_from_descr(str descr0, str descr1, double mix):
 *     cdef InterpolFunc* out = InterpolFunc_new_from_descriptor(descr0, 1)  # force new
 *     cdef InterpolFunc* blend = InterpolFunc_new_from_descriptor(descr1, 1)  # force new             # <<<<<<<<<<<<<<
 *     out.blend_func = blend
 *     out.mix = mix
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.forcenew = 1;
  __pyx_t_1 = __pyx_f_4bpf4_4core_InterpolFunc_new_from_descriptor(__pyx_v_descr1, &__pyx_t_2); 
  __pyx_v_blend = __pyx_t_1;

  /* "bpf4/core.pyx":439
 *     cdef InterpolFunc* out = InterpolFunc_new_from_descriptor(descr0, 1)  # force new
 *     cdef InterpolFunc* blend = InterpolFunc_new_from_descriptor(descr1, 1)  # force new
 *     out.blend_func = blend             # <<<<<<<<<<<<<<
 *     out.mix = mix
 *     return out
 */
  __pyx_v_out->blend_func = __pyx_v_blend;

  /* "bpf4/core.pyx":440
 *     cdef InterpolFunc* blend = InterpolFunc_new_from_descriptor(descr1, 1)  # force new
 *     out.blend_func = blend
 *     out.mix = mix             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  __pyx_v_out->mix = __pyx_v_mix;

  /* "bpf4/core.pyx":441
 *     out.blend_func = blend
 *     out.mix = mix
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef InterpolFunc* InterpolFunc_new_from_descriptor(str descr, int forcenew=0):
 */
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bpf4/core.pyx":436
 *     return out
 * 
 * cdef inline InterpolFunc* InterpolFunc_new_blend_from_descr(str descr0, str descr1, double mix):             # <<<<<<<<<<<<<<
 *     cdef InterpolFunc* out = InterpolFunc_new_from_descriptor(descr0, 1)  # force new
 *     cdef InterpolFunc* blend = InterpolFunc_new_from_descriptor(descr1, 1)  # force new
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":443
 *     return out
 * 
 * cdef InterpolFunc* InterpolFunc_new_from_descriptor(str descr, int forcenew=0):             # <<<<<<<<<<<<<<
 *     cdef InterpolFunc* out = NULL
 *     cdef double exp = 1.0
 */

static __pyx_t_4bpf4_4core_InterpolFunc *__pyx_f_4bpf4_4core_InterpolFunc_new_from_descriptor(PyObject *__pyx_v_descr, struct __pyx_opt_args_4bpf4_4core_InterpolFunc_new_from_descriptor *__pyx_optional_args) {
  int __pyx_v_forcenew = ((int)0);
  __pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_out;
  double __pyx_v_exp;
  PyObject *__pyx_v_func_name = 0;
  PyObject *__pyx_v_param = NULL;
  __pyx_t_4bpf4_4core_InterpolFunc *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  double __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("InterpolFunc_new_from_descriptor", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_forcenew = __pyx_optional_args->forcenew;
    }
  }

  /* "bpf4/core.pyx":444
 * 
 * cdef InterpolFunc* InterpolFunc_new_from_descriptor(str descr, int forcenew=0):
 *     cdef InterpolFunc* out = NULL             # <<<<<<<<<<<<<<
 *     cdef double exp = 1.0
 *     cdef str func_name
 */
  __pyx_v_out = NULL;

  /* "bpf4/core.pyx":445
 * cdef InterpolFunc* InterpolFunc_new_from_descriptor(str descr, int forcenew=0):
 *     cdef InterpolFunc* out = NULL
 *     cdef double exp = 1.0             # <<<<<<<<<<<<<<
 *     cdef str func_name
 *     if "(" in descr:
 */
  __pyx_v_exp = 1.0;

  /* "bpf4/core.pyx":447
 *     cdef double exp = 1.0
 *     cdef str func_name
 *     if "(" in descr:             # <<<<<<<<<<<<<<
 *         func_name, param = descr.split("(")
 *         exp = float(param[:len(param)-1])
 */
  if (unlikely(__pyx_v_descr == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 447, __pyx_L1_error)
  }
  __pyx_t_1 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u_, __pyx_v_descr, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 447, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":448
 *     cdef str func_name
 *     if "(" in descr:
 *         func_name, param = descr.split("(")             # <<<<<<<<<<<<<<
 *         exp = float(param[:len(param)-1])
 *     else:
 */
    if (unlikely(__pyx_v_descr == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "split");
      __PYX_ERR(0, 448, __pyx_L1_error)
    }
    __pyx_t_3 = PyUnicode_Split(__pyx_v_descr, __pyx_kp_u_, -1L); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (1) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 448, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 448, __pyx_L1_error)
    __pyx_v_func_name = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_v_param = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "bpf4/core.pyx":449
 *     if "(" in descr:
 *         func_name, param = descr.split("(")
 *         exp = float(param[:len(param)-1])             # <<<<<<<<<<<<<<
 *     else:
 *         func_name = descr
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_param); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 449, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_param, 0, (__pyx_t_6 - 1), NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_t_3); if (unlikely(__pyx_t_7 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_exp = __pyx_t_7;

    /* "bpf4/core.pyx":447
 *     cdef double exp = 1.0
 *     cdef str func_name
 *     if "(" in descr:             # <<<<<<<<<<<<<<
 *         func_name, param = descr.split("(")
 *         exp = float(param[:len(param)-1])
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":451
 *         exp = float(param[:len(param)-1])
 *     else:
 *         func_name = descr             # <<<<<<<<<<<<<<
 *     if func_name == 'linear':
 *         if not forcenew:
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_descr);
    __pyx_v_func_name = __pyx_v_descr;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":452
 *     else:
 *         func_name = descr
 *     if func_name == 'linear':             # <<<<<<<<<<<<<<
 *         if not forcenew:
 *             out = InterpolFunc_linear
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_func_name, __pyx_n_u_linear, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 452, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":453
 *         func_name = descr
 *     if func_name == 'linear':
 *         if not forcenew:             # <<<<<<<<<<<<<<
 *             out = InterpolFunc_linear
 *         else:
 */
    __pyx_t_1 = ((!(__pyx_v_forcenew != 0)) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":454
 *     if func_name == 'linear':
 *         if not forcenew:
 *             out = InterpolFunc_linear             # <<<<<<<<<<<<<<
 *         else:
 *             out = InterpolFunc_new(intrp_linear, 1, '', 1)
 */
      __pyx_v_out = __pyx_v_4bpf4_4core_InterpolFunc_linear;

      /* "bpf4/core.pyx":453
 *         func_name = descr
 *     if func_name == 'linear':
 *         if not forcenew:             # <<<<<<<<<<<<<<
 *             out = InterpolFunc_linear
 *         else:
 */
      goto __pyx_L5;
    }

    /* "bpf4/core.pyx":456
 *             out = InterpolFunc_linear
 *         else:
 *             out = InterpolFunc_new(intrp_linear, 1, '', 1)             # <<<<<<<<<<<<<<
 *     elif func_name == 'expon':
 *         out = InterpolFunc_new(intrp_expon, exp, 'expon', 1)
 */
    /*else*/ {
      __pyx_v_out = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_linear, 1.0, ((char *)""), 1);
    }
    __pyx_L5:;

    /* "bpf4/core.pyx":452
 *     else:
 *         func_name = descr
 *     if func_name == 'linear':             # <<<<<<<<<<<<<<
 *         if not forcenew:
 *             out = InterpolFunc_linear
 */
    goto __pyx_L4;
  }

  /* "bpf4/core.pyx":457
 *         else:
 *             out = InterpolFunc_new(intrp_linear, 1, '', 1)
 *     elif func_name == 'expon':             # <<<<<<<<<<<<<<
 *         out = InterpolFunc_new(intrp_expon, exp, 'expon', 1)
 *     elif func_name == 'halfcos':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_func_name, __pyx_n_u_expon, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 457, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":458
 *             out = InterpolFunc_new(intrp_linear, 1, '', 1)
 *     elif func_name == 'expon':
 *         out = InterpolFunc_new(intrp_expon, exp, 'expon', 1)             # <<<<<<<<<<<<<<
 *     elif func_name == 'halfcos':
 *         if exp == 1.0 and not forcenew:
 */
    __pyx_v_out = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_expon, __pyx_v_exp, ((char *)"expon"), 1);

    /* "bpf4/core.pyx":457
 *         else:
 *             out = InterpolFunc_new(intrp_linear, 1, '', 1)
 *     elif func_name == 'expon':             # <<<<<<<<<<<<<<
 *         out = InterpolFunc_new(intrp_expon, exp, 'expon', 1)
 *     elif func_name == 'halfcos':
 */
    goto __pyx_L4;
  }

  /* "bpf4/core.pyx":459
 *     elif func_name == 'expon':
 *         out = InterpolFunc_new(intrp_expon, exp, 'expon', 1)
 *     elif func_name == 'halfcos':             # <<<<<<<<<<<<<<
 *         if exp == 1.0 and not forcenew:
 *             out = InterpolFunc_halfcos
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_func_name, __pyx_n_u_halfcos, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 459, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":460
 *         out = InterpolFunc_new(intrp_expon, exp, 'expon', 1)
 *     elif func_name == 'halfcos':
 *         if exp == 1.0 and not forcenew:             # <<<<<<<<<<<<<<
 *             out = InterpolFunc_halfcos
 *         else:
 */
    __pyx_t_2 = ((__pyx_v_exp == 1.0) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_2 = ((!(__pyx_v_forcenew != 0)) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":461
 *     elif func_name == 'halfcos':
 *         if exp == 1.0 and not forcenew:
 *             out = InterpolFunc_halfcos             # <<<<<<<<<<<<<<
 *         else:
 *             out = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 */
      __pyx_v_out = __pyx_v_4bpf4_4core_InterpolFunc_halfcos;

      /* "bpf4/core.pyx":460
 *         out = InterpolFunc_new(intrp_expon, exp, 'expon', 1)
 *     elif func_name == 'halfcos':
 *         if exp == 1.0 and not forcenew:             # <<<<<<<<<<<<<<
 *             out = InterpolFunc_halfcos
 *         else:
 */
      goto __pyx_L6;
    }

    /* "bpf4/core.pyx":463
 *             out = InterpolFunc_halfcos
 *         else:
 *             out = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)             # <<<<<<<<<<<<<<
 *     elif func_name == 'halfcosexp':
 *         out = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 */
    /*else*/ {
      __pyx_v_out = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_halfcosexp, __pyx_v_exp, ((char *)"halfcosexp"), 1);
    }
    __pyx_L6:;

    /* "bpf4/core.pyx":459
 *     elif func_name == 'expon':
 *         out = InterpolFunc_new(intrp_expon, exp, 'expon', 1)
 *     elif func_name == 'halfcos':             # <<<<<<<<<<<<<<
 *         if exp == 1.0 and not forcenew:
 *             out = InterpolFunc_halfcos
 */
    goto __pyx_L4;
  }

  /* "bpf4/core.pyx":464
 *         else:
 *             out = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 *     elif func_name == 'halfcosexp':             # <<<<<<<<<<<<<<
 *         out = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 *     elif func_name == 'nointerpol':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_func_name, __pyx_n_u_halfcosexp, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":465
 *             out = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 *     elif func_name == 'halfcosexp':
 *         out = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)             # <<<<<<<<<<<<<<
 *     elif func_name == 'nointerpol':
 *         out = InterpolFunc_nointerpol
 */
    __pyx_v_out = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_halfcosexp, __pyx_v_exp, ((char *)"halfcosexp"), 1);

    /* "bpf4/core.pyx":464
 *         else:
 *             out = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 *     elif func_name == 'halfcosexp':             # <<<<<<<<<<<<<<
 *         out = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 *     elif func_name == 'nointerpol':
 */
    goto __pyx_L4;
  }

  /* "bpf4/core.pyx":466
 *     elif func_name == 'halfcosexp':
 *         out = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 *     elif func_name == 'nointerpol':             # <<<<<<<<<<<<<<
 *         out = InterpolFunc_nointerpol
 *     elif func_name == 'nearest':
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_func_name, __pyx_n_u_nointerpol, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 466, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":467
 *         out = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 *     elif func_name == 'nointerpol':
 *         out = InterpolFunc_nointerpol             # <<<<<<<<<<<<<<
 *     elif func_name == 'nearest':
 *         out = InterpolFunc_nearest
 */
    __pyx_v_out = __pyx_v_4bpf4_4core_InterpolFunc_nointerpol;

    /* "bpf4/core.pyx":466
 *     elif func_name == 'halfcosexp':
 *         out = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 *     elif func_name == 'nointerpol':             # <<<<<<<<<<<<<<
 *         out = InterpolFunc_nointerpol
 *     elif func_name == 'nearest':
 */
    goto __pyx_L4;
  }

  /* "bpf4/core.pyx":468
 *     elif func_name == 'nointerpol':
 *         out = InterpolFunc_nointerpol
 *     elif func_name == 'nearest':             # <<<<<<<<<<<<<<
 *         out = InterpolFunc_nearest
 *     elif func_name == 'smooth':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_func_name, __pyx_n_u_nearest, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 468, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":469
 *         out = InterpolFunc_nointerpol
 *     elif func_name == 'nearest':
 *         out = InterpolFunc_nearest             # <<<<<<<<<<<<<<
 *     elif func_name == 'smooth':
 *         out = InterpolFunc_smooth
 */
    __pyx_v_out = __pyx_v_4bpf4_4core_InterpolFunc_nearest;

    /* "bpf4/core.pyx":468
 *     elif func_name == 'nointerpol':
 *         out = InterpolFunc_nointerpol
 *     elif func_name == 'nearest':             # <<<<<<<<<<<<<<
 *         out = InterpolFunc_nearest
 *     elif func_name == 'smooth':
 */
    goto __pyx_L4;
  }

  /* "bpf4/core.pyx":470
 *     elif func_name == 'nearest':
 *         out = InterpolFunc_nearest
 *     elif func_name == 'smooth':             # <<<<<<<<<<<<<<
 *         out = InterpolFunc_smooth
 *     return out
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_func_name, __pyx_n_u_smooth, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 470, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":471
 *         out = InterpolFunc_nearest
 *     elif func_name == 'smooth':
 *         out = InterpolFunc_smooth             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
    __pyx_v_out = __pyx_v_4bpf4_4core_InterpolFunc_smooth;

    /* "bpf4/core.pyx":470
 *     elif func_name == 'nearest':
 *         out = InterpolFunc_nearest
 *     elif func_name == 'smooth':             # <<<<<<<<<<<<<<
 *         out = InterpolFunc_smooth
 *     return out
 */
  }
  __pyx_L4:;

  /* "bpf4/core.pyx":472
 *     elif func_name == 'smooth':
 *         out = InterpolFunc_smooth
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef inline double InterpolFunc_call(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 */
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bpf4/core.pyx":443
 *     return out
 * 
 * cdef InterpolFunc* InterpolFunc_new_from_descriptor(str descr, int forcenew=0):             # <<<<<<<<<<<<<<
 *     cdef InterpolFunc* out = NULL
 *     cdef double exp = 1.0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("bpf4.core.InterpolFunc_new_from_descriptor", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_func_name);
  __Pyx_XDECREF(__pyx_v_param);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":474
 *     return out
 * 
 * cdef inline double InterpolFunc_call(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef double v0, v1
 *     if self.mix <= 0:
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core_InterpolFunc_call(__pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self, double __pyx_v_x, double __pyx_v_x0, double __pyx_v_y0, double __pyx_v_x1, double __pyx_v_y1) {
  double __pyx_v_v0;
  double __pyx_v_v1;
  double __pyx_r;
  int __pyx_t_1;

  /* "bpf4/core.pyx":476
 * cdef inline double InterpolFunc_call(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 *     cdef double v0, v1
 *     if self.mix <= 0:             # <<<<<<<<<<<<<<
 *         return self.func(self, x, x0, y0, x1, y1)
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_self->mix <= 0.0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":477
 *     cdef double v0, v1
 *     if self.mix <= 0:
 *         return self.func(self, x, x0, y0, x1, y1)             # <<<<<<<<<<<<<<
 *     else:
 *         v0 = self.func(self, x, x0, y0, x1, y1)
 */
    __pyx_r = __pyx_v_self->func(__pyx_v_self, __pyx_v_x, __pyx_v_x0, __pyx_v_y0, __pyx_v_x1, __pyx_v_y1);
    goto __pyx_L0;

    /* "bpf4/core.pyx":476
 * cdef inline double InterpolFunc_call(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 *     cdef double v0, v1
 *     if self.mix <= 0:             # <<<<<<<<<<<<<<
 *         return self.func(self, x, x0, y0, x1, y1)
 *     else:
 */
  }

  /* "bpf4/core.pyx":479
 *         return self.func(self, x, x0, y0, x1, y1)
 *     else:
 *         v0 = self.func(self, x, x0, y0, x1, y1)             # <<<<<<<<<<<<<<
 *         v1 = self.blend_func.func(self.blend_func, x, x0, y0, x1, y1)
 *         return v0 * (1 - self.mix) + v1 * self.mix
 */
  /*else*/ {
    __pyx_v_v0 = __pyx_v_self->func(__pyx_v_self, __pyx_v_x, __pyx_v_x0, __pyx_v_y0, __pyx_v_x1, __pyx_v_y1);

    /* "bpf4/core.pyx":480
 *     else:
 *         v0 = self.func(self, x, x0, y0, x1, y1)
 *         v1 = self.blend_func.func(self.blend_func, x, x0, y0, x1, y1)             # <<<<<<<<<<<<<<
 *         return v0 * (1 - self.mix) + v1 * self.mix
 * 
 */
    __pyx_v_v1 = __pyx_v_self->blend_func->func(__pyx_v_self->blend_func, __pyx_v_x, __pyx_v_x0, __pyx_v_y0, __pyx_v_x1, __pyx_v_y1);

    /* "bpf4/core.pyx":481
 *         v0 = self.func(self, x, x0, y0, x1, y1)
 *         v1 = self.blend_func.func(self.blend_func, x, x0, y0, x1, y1)
 *         return v0 * (1 - self.mix) + v1 * self.mix             # <<<<<<<<<<<<<<
 * 
 * #cdef inline double InterpolFunc_call(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:
 */
    __pyx_r = ((__pyx_v_v0 * (1.0 - __pyx_v_self->mix)) + (__pyx_v_v1 * __pyx_v_self->mix));
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":474
 *     return out
 * 
 * cdef inline double InterpolFunc_call(InterpolFunc *self, double x, double x0, double y0, double x1, double y1) nogil:             # <<<<<<<<<<<<<<
 *     cdef double v0, v1
 *     if self.mix <= 0:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":487
 * #    return y
 * 
 * cdef inline void InterpolFunc_free(InterpolFunc *self):             # <<<<<<<<<<<<<<
 *     if self is not NULL:
 *         if self.blend_func is not NULL:
 */

static CYTHON_INLINE void __pyx_f_4bpf4_4core_InterpolFunc_free(__pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("InterpolFunc_free", 0);

  /* "bpf4/core.pyx":488
 * 
 * cdef inline void InterpolFunc_free(InterpolFunc *self):
 *     if self is not NULL:             # <<<<<<<<<<<<<<
 *         if self.blend_func is not NULL:
 *             InterpolFunc_free(self.blend_func)
 */
  __pyx_t_1 = ((__pyx_v_self != NULL) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":489
 * cdef inline void InterpolFunc_free(InterpolFunc *self):
 *     if self is not NULL:
 *         if self.blend_func is not NULL:             # <<<<<<<<<<<<<<
 *             InterpolFunc_free(self.blend_func)
 *         if self.needs_free == 1:
 */
    __pyx_t_1 = ((__pyx_v_self->blend_func != NULL) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":490
 *     if self is not NULL:
 *         if self.blend_func is not NULL:
 *             InterpolFunc_free(self.blend_func)             # <<<<<<<<<<<<<<
 *         if self.needs_free == 1:
 *             free(self)
 */
      __pyx_f_4bpf4_4core_InterpolFunc_free(__pyx_v_self->blend_func);

      /* "bpf4/core.pyx":489
 * cdef inline void InterpolFunc_free(InterpolFunc *self):
 *     if self is not NULL:
 *         if self.blend_func is not NULL:             # <<<<<<<<<<<<<<
 *             InterpolFunc_free(self.blend_func)
 *         if self.needs_free == 1:
 */
    }

    /* "bpf4/core.pyx":491
 *         if self.blend_func is not NULL:
 *             InterpolFunc_free(self.blend_func)
 *         if self.needs_free == 1:             # <<<<<<<<<<<<<<
 *             free(self)
 * 
 */
    __pyx_t_1 = ((__pyx_v_self->needs_free == 1) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":492
 *             InterpolFunc_free(self.blend_func)
 *         if self.needs_free == 1:
 *             free(self)             # <<<<<<<<<<<<<<
 * 
 * cdef inline str InterpolFunc_get_descriptor(InterpolFunc *self):
 */
      free(__pyx_v_self);

      /* "bpf4/core.pyx":491
 *         if self.blend_func is not NULL:
 *             InterpolFunc_free(self.blend_func)
 *         if self.needs_free == 1:             # <<<<<<<<<<<<<<
 *             free(self)
 * 
 */
    }

    /* "bpf4/core.pyx":488
 * 
 * cdef inline void InterpolFunc_free(InterpolFunc *self):
 *     if self is not NULL:             # <<<<<<<<<<<<<<
 *         if self.blend_func is not NULL:
 *             InterpolFunc_free(self.blend_func)
 */
  }

  /* "bpf4/core.pyx":487
 * #    return y
 * 
 * cdef inline void InterpolFunc_free(InterpolFunc *self):             # <<<<<<<<<<<<<<
 *     if self is not NULL:
 *         if self.blend_func is not NULL:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":494
 *             free(self)
 * 
 * cdef inline str InterpolFunc_get_descriptor(InterpolFunc *self):             # <<<<<<<<<<<<<<
 *     if self.exp != 1.0:
 *         return "%s(%s)" % (self.name, str(self.exp))
 */

static CYTHON_INLINE PyObject *__pyx_f_4bpf4_4core_InterpolFunc_get_descriptor(__pyx_t_4bpf4_4core_InterpolFunc *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("InterpolFunc_get_descriptor", 0);

  /* "bpf4/core.pyx":495
 * 
 * cdef inline str InterpolFunc_get_descriptor(InterpolFunc *self):
 *     if self.exp != 1.0:             # <<<<<<<<<<<<<<
 *         return "%s(%s)" % (self.name, str(self.exp))
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_self->exp != 1.0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":496
 * cdef inline str InterpolFunc_get_descriptor(InterpolFunc *self):
 *     if self.exp != 1.0:
 *         return "%s(%s)" % (self.name, str(self.exp))             # <<<<<<<<<<<<<<
 *     else:
 *         return self.name
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __pyx_t_5 = __Pyx_PyStr_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u_);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u_);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_);
    __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->exp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__2);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__2);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u__2);
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":495
 * 
 * cdef inline str InterpolFunc_get_descriptor(InterpolFunc *self):
 *     if self.exp != 1.0:             # <<<<<<<<<<<<<<
 *         return "%s(%s)" % (self.name, str(self.exp))
 *     else:
 */
  }

  /* "bpf4/core.pyx":498
 *         return "%s(%s)" % (self.name, str(self.exp))
 *     else:
 *         return self.name             # <<<<<<<<<<<<<<
 * 
 * # create the most used interpolation functions, which are shared across BPFs
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyUnicode_FromString(__pyx_v_self->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":494
 *             free(self)
 * 
 * cdef inline str InterpolFunc_get_descriptor(InterpolFunc *self):             # <<<<<<<<<<<<<<
 *     if self.exp != 1.0:
 *         return "%s(%s)" % (self.name, str(self.exp))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core.InterpolFunc_get_descriptor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":509
 * 
 * 
 * cdef inline ndarray EMPTY1D(int size): #new_empty_doublearray_1D(int size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp *dims = [size]
 *     return PyArray_EMPTY(1, dims, NPY_DOUBLE, 0)
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_4bpf4_4core_EMPTY1D(int __pyx_v_size) {
  npy_intp *__pyx_v_dims;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  npy_intp __pyx_t_1[1];
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("EMPTY1D", 0);

  /* "bpf4/core.pyx":510
 * 
 * cdef inline ndarray EMPTY1D(int size): #new_empty_doublearray_1D(int size):
 *     cdef npy_intp *dims = [size]             # <<<<<<<<<<<<<<
 *     return PyArray_EMPTY(1, dims, NPY_DOUBLE, 0)
 * 
 */
  __pyx_t_1[0] = __pyx_v_size;
  __pyx_v_dims = __pyx_t_1;

  /* "bpf4/core.pyx":511
 * cdef inline ndarray EMPTY1D(int size): #new_empty_doublearray_1D(int size):
 *     cdef npy_intp *dims = [size]
 *     return PyArray_EMPTY(1, dims, NPY_DOUBLE, 0)             # <<<<<<<<<<<<<<
 * 
 * DEF NUM_XS_FOR_RENDERING = 200
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_v_dims, NPY_DOUBLE, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 511, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":509
 * 
 * 
 * cdef inline ndarray EMPTY1D(int size): #new_empty_doublearray_1D(int size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp *dims = [size]
 *     return PyArray_EMPTY(1, dims, NPY_DOUBLE, 0)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core.EMPTY1D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":528
 * 
 * 
 * cpdef int _array_issorted(double[:] xs):             # <<<<<<<<<<<<<<
 *     """
 *     Is this array sorted?
 */

static PyObject *__pyx_pw_4bpf4_4core_3_array_issorted(PyObject *__pyx_self, PyObject *__pyx_arg_xs); /*proto*/
static int __pyx_f_4bpf4_4core__array_issorted(__Pyx_memviewslice __pyx_v_xs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_i;
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_v_nodups;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_array_issorted", 0);

  /* "bpf4/core.pyx":538
 *     cdef int i
 *     cdef double x0, x1
 *     cdef int nodups = 1             # <<<<<<<<<<<<<<
 *     x1 = xs[0]
 *     with nogil:
 */
  __pyx_v_nodups = 1;

  /* "bpf4/core.pyx":539
 *     cdef double x0, x1
 *     cdef int nodups = 1
 *     x1 = xs[0]             # <<<<<<<<<<<<<<
 *     with nogil:
 *         for i in range(1, xs.shape[0]):
 */
  __pyx_t_1 = 0;
  __pyx_v_x1 = (*((double *) ( /* dim=0 */ (__pyx_v_xs.data + __pyx_t_1 * __pyx_v_xs.strides[0]) )));

  /* "bpf4/core.pyx":540
 *     cdef int nodups = 1
 *     x1 = xs[0]
 *     with nogil:             # <<<<<<<<<<<<<<
 *         for i in range(1, xs.shape[0]):
 *             x0 = x1
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "bpf4/core.pyx":541
 *     x1 = xs[0]
 *     with nogil:
 *         for i in range(1, xs.shape[0]):             # <<<<<<<<<<<<<<
 *             x0 = x1
 *             x1 = xs[i]
 */
        __pyx_t_2 = (__pyx_v_xs.shape[0]);
        __pyx_t_3 = __pyx_t_2;
        for (__pyx_t_4 = 1; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
          __pyx_v_i = __pyx_t_4;

          /* "bpf4/core.pyx":542
 *     with nogil:
 *         for i in range(1, xs.shape[0]):
 *             x0 = x1             # <<<<<<<<<<<<<<
 *             x1 = xs[i]
 *             if x1 < x0:
 */
          __pyx_v_x0 = __pyx_v_x1;

          /* "bpf4/core.pyx":543
 *         for i in range(1, xs.shape[0]):
 *             x0 = x1
 *             x1 = xs[i]             # <<<<<<<<<<<<<<
 *             if x1 < x0:
 *                 return -1
 */
          __pyx_t_1 = __pyx_v_i;
          __pyx_v_x1 = (*((double *) ( /* dim=0 */ (__pyx_v_xs.data + __pyx_t_1 * __pyx_v_xs.strides[0]) )));

          /* "bpf4/core.pyx":544
 *             x0 = x1
 *             x1 = xs[i]
 *             if x1 < x0:             # <<<<<<<<<<<<<<
 *                 return -1
 *             elif x1 == x0:
 */
          __pyx_t_5 = ((__pyx_v_x1 < __pyx_v_x0) != 0);
          if (__pyx_t_5) {

            /* "bpf4/core.pyx":545
 *             x1 = xs[i]
 *             if x1 < x0:
 *                 return -1             # <<<<<<<<<<<<<<
 *             elif x1 == x0:
 *                 nodups = 0
 */
            __pyx_r = -1;
            goto __pyx_L3_return;

            /* "bpf4/core.pyx":544
 *             x0 = x1
 *             x1 = xs[i]
 *             if x1 < x0:             # <<<<<<<<<<<<<<
 *                 return -1
 *             elif x1 == x0:
 */
          }

          /* "bpf4/core.pyx":546
 *             if x1 < x0:
 *                 return -1
 *             elif x1 == x0:             # <<<<<<<<<<<<<<
 *                 nodups = 0
 *     return nodups
 */
          __pyx_t_5 = ((__pyx_v_x1 == __pyx_v_x0) != 0);
          if (__pyx_t_5) {

            /* "bpf4/core.pyx":547
 *                 return -1
 *             elif x1 == x0:
 *                 nodups = 0             # <<<<<<<<<<<<<<
 *     return nodups
 * 
 */
            __pyx_v_nodups = 0;

            /* "bpf4/core.pyx":546
 *             if x1 < x0:
 *                 return -1
 *             elif x1 == x0:             # <<<<<<<<<<<<<<
 *                 nodups = 0
 *     return nodups
 */
          }
        }
      }

      /* "bpf4/core.pyx":540
 *     cdef int nodups = 1
 *     x1 = xs[0]
 *     with nogil:             # <<<<<<<<<<<<<<
 *         for i in range(1, xs.shape[0]):
 *             x0 = x1
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L3_return: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L0;
        }
        __pyx_L5:;
      }
  }

  /* "bpf4/core.pyx":548
 *             elif x1 == x0:
 *                 nodups = 0
 *     return nodups             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_nodups;
  goto __pyx_L0;

  /* "bpf4/core.pyx":528
 * 
 * 
 * cpdef int _array_issorted(double[:] xs):             # <<<<<<<<<<<<<<
 *     """
 *     Is this array sorted?
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_3_array_issorted(PyObject *__pyx_self, PyObject *__pyx_arg_xs); /*proto*/
static char __pyx_doc_4bpf4_4core_2_array_issorted[] = "_array_issorted(double[:] xs) -> int\n\n    Is this array sorted?\n\n    Returns:\n        status value: -1=not sorted, 0=array is sorted, with dups, 1=array is sorted, no dups\n\n    ";
static PyMethodDef __pyx_mdef_4bpf4_4core_3_array_issorted = {"_array_issorted", (PyCFunction)__pyx_pw_4bpf4_4core_3_array_issorted, METH_O, __pyx_doc_4bpf4_4core_2_array_issorted};
static PyObject *__pyx_pw_4bpf4_4core_3_array_issorted(PyObject *__pyx_self, PyObject *__pyx_arg_xs) {
  __Pyx_memviewslice __pyx_v_xs = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_array_issorted (wrapper)", 0);
  assert(__pyx_arg_xs); {
    __pyx_v_xs = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_arg_xs, PyBUF_WRITABLE); if (unlikely(!__pyx_v_xs.memview)) __PYX_ERR(0, 528, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._array_issorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_2_array_issorted(__pyx_self, __pyx_v_xs);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_2_array_issorted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_xs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_array_issorted", 0);
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_xs.memview)) { __Pyx_RaiseUnboundLocalError("xs"); __PYX_ERR(0, 528, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4bpf4_4core__array_issorted(__pyx_v_xs, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._array_issorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_xs, 1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":551
 * 
 * 
 * cdef inline int _searchsorted(double [:]xs, double x) nogil:             # <<<<<<<<<<<<<<
 *     cdef int imin = 0
 *     cdef int imax = xs.shape[0]
 */

static CYTHON_INLINE int __pyx_f_4bpf4_4core__searchsorted(__Pyx_memviewslice __pyx_v_xs, double __pyx_v_x) {
  int __pyx_v_imin;
  int __pyx_v_imax;
  int __pyx_v_imid;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;

  /* "bpf4/core.pyx":552
 * 
 * cdef inline int _searchsorted(double [:]xs, double x) nogil:
 *     cdef int imin = 0             # <<<<<<<<<<<<<<
 *     cdef int imax = xs.shape[0]
 *     cdef int imid
 */
  __pyx_v_imin = 0;

  /* "bpf4/core.pyx":553
 * cdef inline int _searchsorted(double [:]xs, double x) nogil:
 *     cdef int imin = 0
 *     cdef int imax = xs.shape[0]             # <<<<<<<<<<<<<<
 *     cdef int imid
 *     while imin < imax:
 */
  __pyx_v_imax = (__pyx_v_xs.shape[0]);

  /* "bpf4/core.pyx":555
 *     cdef int imax = xs.shape[0]
 *     cdef int imid
 *     while imin < imax:             # <<<<<<<<<<<<<<
 *         imid = imin + ((imax - imin) >> 2)
 *         if xs[imid] < x:
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_imin < __pyx_v_imax) != 0);
    if (!__pyx_t_1) break;

    /* "bpf4/core.pyx":556
 *     cdef int imid
 *     while imin < imax:
 *         imid = imin + ((imax - imin) >> 2)             # <<<<<<<<<<<<<<
 *         if xs[imid] < x:
 *             imin = imid + 1
 */
    __pyx_v_imid = (__pyx_v_imin + ((__pyx_v_imax - __pyx_v_imin) >> 2));

    /* "bpf4/core.pyx":557
 *     while imin < imax:
 *         imid = imin + ((imax - imin) >> 2)
 *         if xs[imid] < x:             # <<<<<<<<<<<<<<
 *             imin = imid + 1
 *         else:
 */
    __pyx_t_2 = __pyx_v_imid;
    __pyx_t_1 = (((*((double *) ( /* dim=0 */ (__pyx_v_xs.data + __pyx_t_2 * __pyx_v_xs.strides[0]) ))) < __pyx_v_x) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":558
 *         imid = imin + ((imax - imin) >> 2)
 *         if xs[imid] < x:
 *             imin = imid + 1             # <<<<<<<<<<<<<<
 *         else:
 *             imax = imid
 */
      __pyx_v_imin = (__pyx_v_imid + 1);

      /* "bpf4/core.pyx":557
 *     while imin < imax:
 *         imid = imin + ((imax - imin) >> 2)
 *         if xs[imid] < x:             # <<<<<<<<<<<<<<
 *             imin = imid + 1
 *         else:
 */
      goto __pyx_L5;
    }

    /* "bpf4/core.pyx":560
 *             imin = imid + 1
 *         else:
 *             imax = imid             # <<<<<<<<<<<<<<
 *     return imin
 * 
 */
    /*else*/ {
      __pyx_v_imax = __pyx_v_imid;
    }
    __pyx_L5:;
  }

  /* "bpf4/core.pyx":561
 *         else:
 *             imax = imid
 *     return imin             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_imin;
  goto __pyx_L0;

  /* "bpf4/core.pyx":551
 * 
 * 
 * cdef inline int _searchsorted(double [:]xs, double x) nogil:             # <<<<<<<<<<<<<<
 *     cdef int imin = 0
 *     cdef int imax = xs.shape[0]
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":564
 * 
 * 
 * cdef inline int _csearchlinear(DTYPE_t *xs, int xs_length, DTYPE_t x, int index) nogil:             # <<<<<<<<<<<<<<
 *     # returns -1 if x is left from index
 *     cdef int i = index
 */

static CYTHON_INLINE int __pyx_f_4bpf4_4core__csearchlinear(__pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_xs, int __pyx_v_xs_length, __pyx_t_4bpf4_4core_DTYPE_t __pyx_v_x, int __pyx_v_index) {
  int __pyx_v_i;
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_r;
  int __pyx_t_1;
  long __pyx_t_2;
  long __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;

  /* "bpf4/core.pyx":566
 * cdef inline int _csearchlinear(DTYPE_t *xs, int xs_length, DTYPE_t x, int index) nogil:
 *     # returns -1 if x is left from index
 *     cdef int i = index             # <<<<<<<<<<<<<<
 *     cdef double x0 = xs[i]
 *     if x < x0:
 */
  __pyx_v_i = __pyx_v_index;

  /* "bpf4/core.pyx":567
 *     # returns -1 if x is left from index
 *     cdef int i = index
 *     cdef double x0 = xs[i]             # <<<<<<<<<<<<<<
 *     if x < x0:
 *         return -1
 */
  __pyx_v_x0 = (__pyx_v_xs[__pyx_v_i]);

  /* "bpf4/core.pyx":568
 *     cdef int i = index
 *     cdef double x0 = xs[i]
 *     if x < x0:             # <<<<<<<<<<<<<<
 *         return -1
 *     cdef double x1
 */
  __pyx_t_1 = ((__pyx_v_x < __pyx_v_x0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":569
 *     cdef double x0 = xs[i]
 *     if x < x0:
 *         return -1             # <<<<<<<<<<<<<<
 *     cdef double x1
 *     for i in range(index, xs_length-1):
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "bpf4/core.pyx":568
 *     cdef int i = index
 *     cdef double x0 = xs[i]
 *     if x < x0:             # <<<<<<<<<<<<<<
 *         return -1
 *     cdef double x1
 */
  }

  /* "bpf4/core.pyx":571
 *         return -1
 *     cdef double x1
 *     for i in range(index, xs_length-1):             # <<<<<<<<<<<<<<
 *         x1 = xs[i+1]
 *         if x0 <= x < x1:
 */
  __pyx_t_2 = (__pyx_v_xs_length - 1);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = __pyx_v_index; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "bpf4/core.pyx":572
 *     cdef double x1
 *     for i in range(index, xs_length-1):
 *         x1 = xs[i+1]             # <<<<<<<<<<<<<<
 *         if x0 <= x < x1:
 *             return i
 */
    __pyx_v_x1 = (__pyx_v_xs[(__pyx_v_i + 1)]);

    /* "bpf4/core.pyx":573
 *     for i in range(index, xs_length-1):
 *         x1 = xs[i+1]
 *         if x0 <= x < x1:             # <<<<<<<<<<<<<<
 *             return i
 *         x0 = x1
 */
    __pyx_t_1 = (__pyx_v_x0 <= __pyx_v_x);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_x < __pyx_v_x1);
    }
    __pyx_t_5 = (__pyx_t_1 != 0);
    if (__pyx_t_5) {

      /* "bpf4/core.pyx":574
 *         x1 = xs[i+1]
 *         if x0 <= x < x1:
 *             return i             # <<<<<<<<<<<<<<
 *         x0 = x1
 *     return xs_length-1
 */
      __pyx_r = __pyx_v_i;
      goto __pyx_L0;

      /* "bpf4/core.pyx":573
 *     for i in range(index, xs_length-1):
 *         x1 = xs[i+1]
 *         if x0 <= x < x1:             # <<<<<<<<<<<<<<
 *             return i
 *         x0 = x1
 */
    }

    /* "bpf4/core.pyx":575
 *         if x0 <= x < x1:
 *             return i
 *         x0 = x1             # <<<<<<<<<<<<<<
 *     return xs_length-1
 * 
 */
    __pyx_v_x0 = __pyx_v_x1;
  }

  /* "bpf4/core.pyx":576
 *             return i
 *         x0 = x1
 *     return xs_length-1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_xs_length - 1);
  goto __pyx_L0;

  /* "bpf4/core.pyx":564
 * 
 * 
 * cdef inline int _csearchlinear(DTYPE_t *xs, int xs_length, DTYPE_t x, int index) nogil:             # <<<<<<<<<<<<<<
 *     # returns -1 if x is left from index
 *     cdef int i = index
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":580
 * 
 * 
 * cdef inline int _csearchsorted(DTYPE_t *xs, int xs_length, DTYPE_t x) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     equivalent to bisect_right.
 */

static CYTHON_INLINE int __pyx_f_4bpf4_4core__csearchsorted(__pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_xs, int __pyx_v_xs_length, __pyx_t_4bpf4_4core_DTYPE_t __pyx_v_x) {
  int __pyx_v_imin;
  int __pyx_v_imax;
  int __pyx_v_imid;
  int __pyx_r;
  int __pyx_t_1;

  /* "bpf4/core.pyx":585
 *     xs[out] > x
 *     """
 *     cdef int imin = 0             # <<<<<<<<<<<<<<
 *     cdef int imax = xs_length
 *     cdef int imid
 */
  __pyx_v_imin = 0;

  /* "bpf4/core.pyx":586
 *     """
 *     cdef int imin = 0
 *     cdef int imax = xs_length             # <<<<<<<<<<<<<<
 *     cdef int imid
 *     while imin < imax:
 */
  __pyx_v_imax = __pyx_v_xs_length;

  /* "bpf4/core.pyx":588
 *     cdef int imax = xs_length
 *     cdef int imid
 *     while imin < imax:             # <<<<<<<<<<<<<<
 *         imid = imin + ((imax - imin) >> 2)
 *         if (<DTYPE_t *>(xs))[imid] < x:
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_imin < __pyx_v_imax) != 0);
    if (!__pyx_t_1) break;

    /* "bpf4/core.pyx":589
 *     cdef int imid
 *     while imin < imax:
 *         imid = imin + ((imax - imin) >> 2)             # <<<<<<<<<<<<<<
 *         if (<DTYPE_t *>(xs))[imid] < x:
 *             imin = imid + 1
 */
    __pyx_v_imid = (__pyx_v_imin + ((__pyx_v_imax - __pyx_v_imin) >> 2));

    /* "bpf4/core.pyx":590
 *     while imin < imax:
 *         imid = imin + ((imax - imin) >> 2)
 *         if (<DTYPE_t *>(xs))[imid] < x:             # <<<<<<<<<<<<<<
 *             imin = imid + 1
 *         else:
 */
    __pyx_t_1 = (((((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_xs)[__pyx_v_imid]) < __pyx_v_x) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":591
 *         imid = imin + ((imax - imin) >> 2)
 *         if (<DTYPE_t *>(xs))[imid] < x:
 *             imin = imid + 1             # <<<<<<<<<<<<<<
 *         else:
 *             imax = imid
 */
      __pyx_v_imin = (__pyx_v_imid + 1);

      /* "bpf4/core.pyx":590
 *     while imin < imax:
 *         imid = imin + ((imax - imin) >> 2)
 *         if (<DTYPE_t *>(xs))[imid] < x:             # <<<<<<<<<<<<<<
 *             imin = imid + 1
 *         else:
 */
      goto __pyx_L5;
    }

    /* "bpf4/core.pyx":593
 *             imin = imid + 1
 *         else:
 *             imax = imid             # <<<<<<<<<<<<<<
 *     return imin
 * 
 */
    /*else*/ {
      __pyx_v_imax = __pyx_v_imid;
    }
    __pyx_L5:;
  }

  /* "bpf4/core.pyx":594
 *         else:
 *             imax = imid
 *     return imin             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_imin;
  goto __pyx_L0;

  /* "bpf4/core.pyx":580
 * 
 * 
 * cdef inline int _csearchsorted(DTYPE_t *xs, int xs_length, DTYPE_t x) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     equivalent to bisect_right.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":597
 * 
 * 
 * cdef inline int _csearchsorted_left(DTYPE_t *xs, int xs_length, DTYPE_t x) nogil:             # <<<<<<<<<<<<<<
 *     cdef int imin = 0
 *     cdef int imax = xs_length
 */

static CYTHON_INLINE int __pyx_f_4bpf4_4core__csearchsorted_left(__pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_xs, int __pyx_v_xs_length, __pyx_t_4bpf4_4core_DTYPE_t __pyx_v_x) {
  int __pyx_v_imin;
  int __pyx_v_imax;
  int __pyx_v_imid;
  int __pyx_r;
  int __pyx_t_1;

  /* "bpf4/core.pyx":598
 * 
 * cdef inline int _csearchsorted_left(DTYPE_t *xs, int xs_length, DTYPE_t x) nogil:
 *     cdef int imin = 0             # <<<<<<<<<<<<<<
 *     cdef int imax = xs_length
 *     cdef int imid
 */
  __pyx_v_imin = 0;

  /* "bpf4/core.pyx":599
 * cdef inline int _csearchsorted_left(DTYPE_t *xs, int xs_length, DTYPE_t x) nogil:
 *     cdef int imin = 0
 *     cdef int imax = xs_length             # <<<<<<<<<<<<<<
 *     cdef int imid
 *     while imin < imax:
 */
  __pyx_v_imax = __pyx_v_xs_length;

  /* "bpf4/core.pyx":601
 *     cdef int imax = xs_length
 *     cdef int imid
 *     while imin < imax:             # <<<<<<<<<<<<<<
 *         imid = imin + ((imax - imin) >> 2)
 *         if xs[imid] <= x:
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_imin < __pyx_v_imax) != 0);
    if (!__pyx_t_1) break;

    /* "bpf4/core.pyx":602
 *     cdef int imid
 *     while imin < imax:
 *         imid = imin + ((imax - imin) >> 2)             # <<<<<<<<<<<<<<
 *         if xs[imid] <= x:
 *             imin = imid + 1
 */
    __pyx_v_imid = (__pyx_v_imin + ((__pyx_v_imax - __pyx_v_imin) >> 2));

    /* "bpf4/core.pyx":603
 *     while imin < imax:
 *         imid = imin + ((imax - imin) >> 2)
 *         if xs[imid] <= x:             # <<<<<<<<<<<<<<
 *             imin = imid + 1
 *         else:
 */
    __pyx_t_1 = (((__pyx_v_xs[__pyx_v_imid]) <= __pyx_v_x) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":604
 *         imid = imin + ((imax - imin) >> 2)
 *         if xs[imid] <= x:
 *             imin = imid + 1             # <<<<<<<<<<<<<<
 *         else:
 *             imax = imid
 */
      __pyx_v_imin = (__pyx_v_imid + 1);

      /* "bpf4/core.pyx":603
 *     while imin < imax:
 *         imid = imin + ((imax - imin) >> 2)
 *         if xs[imid] <= x:             # <<<<<<<<<<<<<<
 *             imin = imid + 1
 *         else:
 */
      goto __pyx_L5;
    }

    /* "bpf4/core.pyx":606
 *             imin = imid + 1
 *         else:
 *             imax = imid             # <<<<<<<<<<<<<<
 *     return imin
 * 
 */
    /*else*/ {
      __pyx_v_imax = __pyx_v_imid;
    }
    __pyx_L5:;
  }

  /* "bpf4/core.pyx":607
 *         else:
 *             imax = imid
 *     return imin             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_imin;
  goto __pyx_L0;

  /* "bpf4/core.pyx":597
 * 
 * 
 * cdef inline int _csearchsorted_left(DTYPE_t *xs, int xs_length, DTYPE_t x) nogil:             # <<<<<<<<<<<<<<
 *     cdef int imin = 0
 *     cdef int imax = xs_length
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":610
 * 
 * 
 * cdef inline double* _seq_to_doubles(xs):             # <<<<<<<<<<<<<<
 *     cdef int size, i
 *     cdef double* out
 */

static CYTHON_INLINE double *__pyx_f_4bpf4_4core__seq_to_doubles(PyObject *__pyx_v_xs) {
  int __pyx_v_size;
  int __pyx_v_i;
  double *__pyx_v_out;
  double *__pyx_v_data;
  double *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  double __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_seq_to_doubles", 0);

  /* "bpf4/core.pyx":614
 *     cdef double* out
 *     cdef double* data
 *     if isinstance(xs, ndarray):             # <<<<<<<<<<<<<<
 *         size = PyArray_DIM(<ndarray>xs, 0)
 *         out = <double *>malloc(sizeof(double) * size)
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_xs, __pyx_ptype_5numpy_ndarray); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":615
 *     cdef double* data
 *     if isinstance(xs, ndarray):
 *         size = PyArray_DIM(<ndarray>xs, 0)             # <<<<<<<<<<<<<<
 *         out = <double *>malloc(sizeof(double) * size)
 *         if PyArray_ISCONTIGUOUS(<ndarray>xs):
 */
    __pyx_v_size = PyArray_DIM(((PyArrayObject *)__pyx_v_xs), 0);

    /* "bpf4/core.pyx":616
 *     if isinstance(xs, ndarray):
 *         size = PyArray_DIM(<ndarray>xs, 0)
 *         out = <double *>malloc(sizeof(double) * size)             # <<<<<<<<<<<<<<
 *         if PyArray_ISCONTIGUOUS(<ndarray>xs):
 *             data = <DTYPE_t *>((<ndarray>xs).data)
 */
    __pyx_v_out = ((double *)malloc(((sizeof(double)) * __pyx_v_size)));

    /* "bpf4/core.pyx":617
 *         size = PyArray_DIM(<ndarray>xs, 0)
 *         out = <double *>malloc(sizeof(double) * size)
 *         if PyArray_ISCONTIGUOUS(<ndarray>xs):             # <<<<<<<<<<<<<<
 *             data = <DTYPE_t *>((<ndarray>xs).data)
 *             for i in range(size):
 */
    __pyx_t_2 = (PyArray_ISCONTIGUOUS(((PyArrayObject *)__pyx_v_xs)) != 0);
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":618
 *         out = <double *>malloc(sizeof(double) * size)
 *         if PyArray_ISCONTIGUOUS(<ndarray>xs):
 *             data = <DTYPE_t *>((<ndarray>xs).data)             # <<<<<<<<<<<<<<
 *             for i in range(size):
 *                 out[i] = data[i]
 */
      __pyx_v_data = ((__pyx_t_4bpf4_4core_DTYPE_t *)((PyArrayObject *)__pyx_v_xs)->data);

      /* "bpf4/core.pyx":619
 *         if PyArray_ISCONTIGUOUS(<ndarray>xs):
 *             data = <DTYPE_t *>((<ndarray>xs).data)
 *             for i in range(size):             # <<<<<<<<<<<<<<
 *                 out[i] = data[i]
 *         else:
 */
      __pyx_t_3 = __pyx_v_size;
      __pyx_t_4 = __pyx_t_3;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

        /* "bpf4/core.pyx":620
 *             data = <DTYPE_t *>((<ndarray>xs).data)
 *             for i in range(size):
 *                 out[i] = data[i]             # <<<<<<<<<<<<<<
 *         else:
 *             for i in range(size):
 */
        (__pyx_v_out[__pyx_v_i]) = (__pyx_v_data[__pyx_v_i]);
      }

      /* "bpf4/core.pyx":617
 *         size = PyArray_DIM(<ndarray>xs, 0)
 *         out = <double *>malloc(sizeof(double) * size)
 *         if PyArray_ISCONTIGUOUS(<ndarray>xs):             # <<<<<<<<<<<<<<
 *             data = <DTYPE_t *>((<ndarray>xs).data)
 *             for i in range(size):
 */
      goto __pyx_L4;
    }

    /* "bpf4/core.pyx":622
 *                 out[i] = data[i]
 *         else:
 *             for i in range(size):             # <<<<<<<<<<<<<<
 *                 out[i] = xs[i]
 *     else:
 */
    /*else*/ {
      __pyx_t_3 = __pyx_v_size;
      __pyx_t_4 = __pyx_t_3;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

        /* "bpf4/core.pyx":623
 *         else:
 *             for i in range(size):
 *                 out[i] = xs[i]             # <<<<<<<<<<<<<<
 *     else:
 *         if isinstance(xs, list):
 */
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_xs, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        (__pyx_v_out[__pyx_v_i]) = __pyx_t_7;
      }
    }
    __pyx_L4:;

    /* "bpf4/core.pyx":614
 *     cdef double* out
 *     cdef double* data
 *     if isinstance(xs, ndarray):             # <<<<<<<<<<<<<<
 *         size = PyArray_DIM(<ndarray>xs, 0)
 *         out = <double *>malloc(sizeof(double) * size)
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":625
 *                 out[i] = xs[i]
 *     else:
 *         if isinstance(xs, list):             # <<<<<<<<<<<<<<
 *             size = len(<list>xs)
 *             out = <double *>malloc(sizeof(double) * size)
 */
  /*else*/ {
    __pyx_t_2 = PyList_Check(__pyx_v_xs); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":626
 *     else:
 *         if isinstance(xs, list):
 *             size = len(<list>xs)             # <<<<<<<<<<<<<<
 *             out = <double *>malloc(sizeof(double) * size)
 *             for i in range(size):
 */
      if (unlikely(__pyx_v_xs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 626, __pyx_L1_error)
      }
      __pyx_t_8 = PyList_GET_SIZE(((PyObject*)__pyx_v_xs)); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 626, __pyx_L1_error)
      __pyx_v_size = __pyx_t_8;

      /* "bpf4/core.pyx":627
 *         if isinstance(xs, list):
 *             size = len(<list>xs)
 *             out = <double *>malloc(sizeof(double) * size)             # <<<<<<<<<<<<<<
 *             for i in range(size):
 *                 out[i] = (<list>xs)[i]
 */
      __pyx_v_out = ((double *)malloc(((sizeof(double)) * __pyx_v_size)));

      /* "bpf4/core.pyx":628
 *             size = len(<list>xs)
 *             out = <double *>malloc(sizeof(double) * size)
 *             for i in range(size):             # <<<<<<<<<<<<<<
 *                 out[i] = (<list>xs)[i]
 *         elif isinstance(xs, tuple):
 */
      __pyx_t_3 = __pyx_v_size;
      __pyx_t_4 = __pyx_t_3;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

        /* "bpf4/core.pyx":629
 *             out = <double *>malloc(sizeof(double) * size)
 *             for i in range(size):
 *                 out[i] = (<list>xs)[i]             # <<<<<<<<<<<<<<
 *         elif isinstance(xs, tuple):
 *             size = len(<tuple>xs)
 */
        if (unlikely(__pyx_v_xs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 629, __pyx_L1_error)
        }
        __pyx_t_7 = __pyx_PyFloat_AsDouble(PyList_GET_ITEM(((PyObject*)__pyx_v_xs), __pyx_v_i)); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 629, __pyx_L1_error)
        (__pyx_v_out[__pyx_v_i]) = __pyx_t_7;
      }

      /* "bpf4/core.pyx":625
 *                 out[i] = xs[i]
 *     else:
 *         if isinstance(xs, list):             # <<<<<<<<<<<<<<
 *             size = len(<list>xs)
 *             out = <double *>malloc(sizeof(double) * size)
 */
      goto __pyx_L9;
    }

    /* "bpf4/core.pyx":630
 *             for i in range(size):
 *                 out[i] = (<list>xs)[i]
 *         elif isinstance(xs, tuple):             # <<<<<<<<<<<<<<
 *             size = len(<tuple>xs)
 *             out = <double *>malloc(sizeof(double) * size)
 */
    __pyx_t_1 = PyTuple_Check(__pyx_v_xs); 
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":631
 *                 out[i] = (<list>xs)[i]
 *         elif isinstance(xs, tuple):
 *             size = len(<tuple>xs)             # <<<<<<<<<<<<<<
 *             out = <double *>malloc(sizeof(double) * size)
 *             for i in range(size):
 */
      if (unlikely(__pyx_v_xs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 631, __pyx_L1_error)
      }
      __pyx_t_8 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_xs)); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 631, __pyx_L1_error)
      __pyx_v_size = __pyx_t_8;

      /* "bpf4/core.pyx":632
 *         elif isinstance(xs, tuple):
 *             size = len(<tuple>xs)
 *             out = <double *>malloc(sizeof(double) * size)             # <<<<<<<<<<<<<<
 *             for i in range(size):
 *                 out[i] = (<tuple>xs)[i]
 */
      __pyx_v_out = ((double *)malloc(((sizeof(double)) * __pyx_v_size)));

      /* "bpf4/core.pyx":633
 *             size = len(<tuple>xs)
 *             out = <double *>malloc(sizeof(double) * size)
 *             for i in range(size):             # <<<<<<<<<<<<<<
 *                 out[i] = (<tuple>xs)[i]
 *         else:
 */
      __pyx_t_3 = __pyx_v_size;
      __pyx_t_4 = __pyx_t_3;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

        /* "bpf4/core.pyx":634
 *             out = <double *>malloc(sizeof(double) * size)
 *             for i in range(size):
 *                 out[i] = (<tuple>xs)[i]             # <<<<<<<<<<<<<<
 *         else:
 *             size = len(xs)
 */
        if (unlikely(__pyx_v_xs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 634, __pyx_L1_error)
        }
        __pyx_t_7 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(((PyObject*)__pyx_v_xs), __pyx_v_i)); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 634, __pyx_L1_error)
        (__pyx_v_out[__pyx_v_i]) = __pyx_t_7;
      }

      /* "bpf4/core.pyx":630
 *             for i in range(size):
 *                 out[i] = (<list>xs)[i]
 *         elif isinstance(xs, tuple):             # <<<<<<<<<<<<<<
 *             size = len(<tuple>xs)
 *             out = <double *>malloc(sizeof(double) * size)
 */
      goto __pyx_L9;
    }

    /* "bpf4/core.pyx":636
 *                 out[i] = (<tuple>xs)[i]
 *         else:
 *             size = len(xs)             # <<<<<<<<<<<<<<
 *             out = <double *>malloc(sizeof(double) * size)
 *             for i in range(size):
 */
    /*else*/ {
      __pyx_t_8 = PyObject_Length(__pyx_v_xs); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 636, __pyx_L1_error)
      __pyx_v_size = __pyx_t_8;

      /* "bpf4/core.pyx":637
 *         else:
 *             size = len(xs)
 *             out = <double *>malloc(sizeof(double) * size)             # <<<<<<<<<<<<<<
 *             for i in range(size):
 *                 out[i] = xs[i]
 */
      __pyx_v_out = ((double *)malloc(((sizeof(double)) * __pyx_v_size)));

      /* "bpf4/core.pyx":638
 *             size = len(xs)
 *             out = <double *>malloc(sizeof(double) * size)
 *             for i in range(size):             # <<<<<<<<<<<<<<
 *                 out[i] = xs[i]
 *     return out
 */
      __pyx_t_3 = __pyx_v_size;
      __pyx_t_4 = __pyx_t_3;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

        /* "bpf4/core.pyx":639
 *             out = <double *>malloc(sizeof(double) * size)
 *             for i in range(size):
 *                 out[i] = xs[i]             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_xs, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 639, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        (__pyx_v_out[__pyx_v_i]) = __pyx_t_7;
      }
    }
    __pyx_L9:;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":640
 *             for i in range(size):
 *                 out[i] = xs[i]
 *     return out             # <<<<<<<<<<<<<<
 * 
 * def _get_bounds(a, b):
 */
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bpf4/core.pyx":610
 * 
 * 
 * cdef inline double* _seq_to_doubles(xs):             # <<<<<<<<<<<<<<
 *     cdef int size, i
 *     cdef double* out
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("bpf4.core._seq_to_doubles", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":642
 *     return out
 * 
 * def _get_bounds(a, b):             # <<<<<<<<<<<<<<
 *     cdef double start, end, b_start, b_end
 *     start, end = a.bounds()
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5_get_bounds(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_4_get_bounds[] = "_get_bounds(a, b)";
static PyMethodDef __pyx_mdef_4bpf4_4core_5_get_bounds = {"_get_bounds", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_5_get_bounds, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_4_get_bounds};
static PyObject *__pyx_pw_4bpf4_4core_5_get_bounds(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_b = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_bounds (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_bounds", 1, 2, 2, 1); __PYX_ERR(0, 642, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_bounds") < 0)) __PYX_ERR(0, 642, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_a = values[0];
    __pyx_v_b = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_bounds", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 642, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._get_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_4_get_bounds(__pyx_self, __pyx_v_a, __pyx_v_b);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_4_get_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  double __pyx_v_start;
  double __pyx_v_end;
  double __pyx_v_b_start;
  double __pyx_v_b_end;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  double __pyx_t_6;
  double __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_bounds", 0);

  /* "bpf4/core.pyx":644
 * def _get_bounds(a, b):
 *     cdef double start, end, b_start, b_end
 *     start, end = a.bounds()             # <<<<<<<<<<<<<<
 *     try:
 *         b_start, b_end = b.bounds()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_bounds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 644, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 644, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 644, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_start = __pyx_t_6;
  __pyx_v_end = __pyx_t_7;

  /* "bpf4/core.pyx":645
 *     cdef double start, end, b_start, b_end
 *     start, end = a.bounds()
 *     try:             # <<<<<<<<<<<<<<
 *         b_start, b_end = b.bounds()
 *         start = start if start < b_start else b_start
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "bpf4/core.pyx":646
 *     start, end = a.bounds()
 *     try:
 *         b_start, b_end = b.bounds()             # <<<<<<<<<<<<<<
 *         start = start if start < b_start else b_start
 *         end = end if end > b_end else b_end
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_bounds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 646, __pyx_L5_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        #else
        __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
        index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 646, __pyx_L5_error)
        __pyx_t_5 = NULL;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L12_unpacking_done;
        __pyx_L11_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 646, __pyx_L5_error)
        __pyx_L12_unpacking_done:;
      }
      __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 646, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 646, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_b_start = __pyx_t_7;
      __pyx_v_b_end = __pyx_t_6;

      /* "bpf4/core.pyx":647
 *     try:
 *         b_start, b_end = b.bounds()
 *         start = start if start < b_start else b_start             # <<<<<<<<<<<<<<
 *         end = end if end > b_end else b_end
 *     except:
 */
      if (((__pyx_v_start < __pyx_v_b_start) != 0)) {
        __pyx_t_6 = __pyx_v_start;
      } else {
        __pyx_t_6 = __pyx_v_b_start;
      }
      __pyx_v_start = __pyx_t_6;

      /* "bpf4/core.pyx":648
 *         b_start, b_end = b.bounds()
 *         start = start if start < b_start else b_start
 *         end = end if end > b_end else b_end             # <<<<<<<<<<<<<<
 *     except:
 *         pass
 */
      if (((__pyx_v_end > __pyx_v_b_end) != 0)) {
        __pyx_t_6 = __pyx_v_end;
      } else {
        __pyx_t_6 = __pyx_v_b_end;
      }
      __pyx_v_end = __pyx_t_6;

      /* "bpf4/core.pyx":645
 *     cdef double start, end, b_start, b_end
 *     start, end = a.bounds()
 *     try:             # <<<<<<<<<<<<<<
 *         b_start, b_end = b.bounds()
 *         start = start if start < b_start else b_start
 */
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L10_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "bpf4/core.pyx":649
 *         start = start if start < b_start else b_start
 *         end = end if end > b_end else b_end
 *     except:             # <<<<<<<<<<<<<<
 *         pass
 *     return (start, end)
 */
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L6_exception_handled;
    }
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    __pyx_L10_try_end:;
  }

  /* "bpf4/core.pyx":651
 *     except:
 *         pass
 *     return (start, end)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":642
 *     return out
 * 
 * def _get_bounds(a, b):             # <<<<<<<<<<<<<<
 *     cdef double start, end, b_start, b_end
 *     start, end = a.bounds()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._get_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":668
 *     cdef double _x0, _x1
 *     cdef int _integration_mode  # 0: dont use scipy, 1: use scipy, -1: calibrate
 *     cpdef BpfInterface _asbpf(self): return self             # <<<<<<<<<<<<<<
 *     cdef void _bounds_changed(self): pass
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_1_asbpf(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface__asbpf(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_asbpf", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_asbpf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_1_asbpf)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 668, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface._asbpf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_1_asbpf(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface__asbpf[] = "BpfInterface._asbpf(self) -> BpfInterface";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_1_asbpf = {"_asbpf", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_1_asbpf, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface__asbpf};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_1_asbpf(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_asbpf (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface__asbpf(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface__asbpf(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_asbpf", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface__asbpf(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface._asbpf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":669
 *     cdef int _integration_mode  # 0: dont use scipy, 1: use scipy, -1: calibrate
 *     cpdef BpfInterface _asbpf(self): return self
 *     cdef void _bounds_changed(self): pass             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void _set_bounds(self, double x0, double x1):
 */

static void __pyx_f_4bpf4_4core_12BpfInterface__bounds_changed(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_bounds_changed", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":671
 *     cdef void _bounds_changed(self): pass
 * 
 *     cdef inline void _set_bounds(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         self._x0 = x0
 *         self._x1 = x1
 */

static CYTHON_INLINE void __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_bounds", 0);

  /* "bpf4/core.pyx":672
 * 
 *     cdef inline void _set_bounds(self, double x0, double x1):
 *         self._x0 = x0             # <<<<<<<<<<<<<<
 *         self._x1 = x1
 *         self._integration_mode = CONFIG['integrate.default_mode']
 */
  __pyx_v_self->_x0 = __pyx_v_x0;

  /* "bpf4/core.pyx":673
 *     cdef inline void _set_bounds(self, double x0, double x1):
 *         self._x0 = x0
 *         self._x1 = x1             # <<<<<<<<<<<<<<
 *         self._integration_mode = CONFIG['integrate.default_mode']
 * 
 */
  __pyx_v_self->_x1 = __pyx_v_x1;

  /* "bpf4/core.pyx":674
 *         self._x0 = x0
 *         self._x1 = x1
 *         self._integration_mode = CONFIG['integrate.default_mode']             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void _set_bounds_like(self, BpfInterface a):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CONFIG); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_kp_u_integrate_default_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->_integration_mode = __pyx_t_3;

  /* "bpf4/core.pyx":671
 *     cdef void _bounds_changed(self): pass
 * 
 *     cdef inline void _set_bounds(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         self._x0 = x0
 *         self._x1 = x1
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("bpf4.core.BpfInterface._set_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":676
 *         self._integration_mode = CONFIG['integrate.default_mode']
 * 
 *     cdef inline void _set_bounds_like(self, BpfInterface a):             # <<<<<<<<<<<<<<
 *         self._set_bounds(a._x0, a._x1)
 * 
 */

static CYTHON_INLINE void __pyx_f_4bpf4_4core_12BpfInterface__set_bounds_like(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_bounds_like", 0);

  /* "bpf4/core.pyx":677
 * 
 *     cdef inline void _set_bounds_like(self, BpfInterface a):
 *         self._set_bounds(a._x0, a._x1)             # <<<<<<<<<<<<<<
 * 
 *     cpdef double ntodx(self, int N):
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(__pyx_v_self, __pyx_v_a->_x0, __pyx_v_a->_x1);

  /* "bpf4/core.pyx":676
 *         self._integration_mode = CONFIG['integrate.default_mode']
 * 
 *     cdef inline void _set_bounds_like(self, BpfInterface a):             # <<<<<<<<<<<<<<
 *         self._set_bounds(a._x0, a._x1)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":679
 *         self._set_bounds(a._x0, a._x1)
 * 
 *     cpdef double ntodx(self, int N):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the sampling period `dx`
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_3ntodx(PyObject *__pyx_v_self, PyObject *__pyx_arg_N); /*proto*/
static double __pyx_f_4bpf4_4core_12BpfInterface_ntodx(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_v_N, int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  double __pyx_t_6;
  long __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ntodx", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ntodx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_3ntodx)) {
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":693
 *             (float) The sampling period
 *         """
 *         return (self._x1 - self._x0) / (N - 1)             # <<<<<<<<<<<<<<
 * 
 *     cpdef int dxton(self, double dx):
 */
  __pyx_t_6 = (__pyx_v_self->_x1 - __pyx_v_self->_x0);
  __pyx_t_7 = (__pyx_v_N - 1);
  if (unlikely(__pyx_t_7 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 693, __pyx_L1_error)
  }
  __pyx_r = (__pyx_t_6 / ((double)__pyx_t_7));
  goto __pyx_L0;

  /* "bpf4/core.pyx":679
 *         self._set_bounds(a._x0, a._x1)
 * 
 *     cpdef double ntodx(self, int N):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the sampling period `dx`
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("bpf4.core.BpfInterface.ntodx", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_3ntodx(PyObject *__pyx_v_self, PyObject *__pyx_arg_N); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_2ntodx[] = "BpfInterface.ntodx(self, int N) -> double\n\n        Calculate the sampling period `dx` \n\n        Calculate `dx` so that the bounds of this bpf \n        are divided into N parts: `dx = (x1-x0) / (N-1)`\n\n        Args:\n            N (int): The number of points to sample within the bounds of\n                this bpf\n\n        Returns:\n            (float) The sampling period\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_3ntodx = {"ntodx", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_3ntodx, METH_O, __pyx_doc_4bpf4_4core_12BpfInterface_2ntodx};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_3ntodx(PyObject *__pyx_v_self, PyObject *__pyx_arg_N) {
  int __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ntodx (wrapper)", 0);
  assert(__pyx_arg_N); {
    __pyx_v_N = __Pyx_PyInt_As_int(__pyx_arg_N); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.ntodx", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_2ntodx(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), ((int)__pyx_v_N));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_2ntodx(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ntodx", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_4bpf4_4core_12BpfInterface_ntodx(__pyx_v_self, __pyx_v_N, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.ntodx", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":695
 *         return (self._x1 - self._x0) / (N - 1)
 * 
 *     cpdef int dxton(self, double dx):             # <<<<<<<<<<<<<<
 *         """
 *         Split the bounds of this bpf according to a given sampling period *dx*
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_5dxton(PyObject *__pyx_v_self, PyObject *__pyx_arg_dx); /*proto*/
static int __pyx_f_4bpf4_4core_12BpfInterface_dxton(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_dx, int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  double __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dxton", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dxton); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_5dxton)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 695, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":715
 * 
 *         """
 *         return <int>(((self._x1 + dx) - self._x0) / dx)             # <<<<<<<<<<<<<<
 * 
 *     def bounds(self):
 */
  __pyx_t_7 = ((__pyx_v_self->_x1 + __pyx_v_dx) - __pyx_v_self->_x0);
  if (unlikely(__pyx_v_dx == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 715, __pyx_L1_error)
  }
  __pyx_r = ((int)(__pyx_t_7 / __pyx_v_dx));
  goto __pyx_L0;

  /* "bpf4/core.pyx":695
 *         return (self._x1 - self._x0) / (N - 1)
 * 
 *     cpdef int dxton(self, double dx):             # <<<<<<<<<<<<<<
 *         """
 *         Split the bounds of this bpf according to a given sampling period *dx*
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("bpf4.core.BpfInterface.dxton", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_5dxton(PyObject *__pyx_v_self, PyObject *__pyx_arg_dx); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_4dxton[] = "BpfInterface.dxton(self, double dx) -> int\n\n        Split the bounds of this bpf according to a given sampling period *dx*\n\n        Args:\n            dx (float): the sampling period\n\n        Returns:\n            (int) The number of points to sample\n\n\n        Calculate the number of points in as a result of dividing the \n        bounds of this bpf by the sampling period `dx`:\n\n            n = (x1 + dx - x0) / dx\n\n        where *x0* and *x1* are the *x* coord start and end points and *dx* \n        is the sampling period.\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_5dxton = {"dxton", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_5dxton, METH_O, __pyx_doc_4bpf4_4core_12BpfInterface_4dxton};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_5dxton(PyObject *__pyx_v_self, PyObject *__pyx_arg_dx) {
  double __pyx_v_dx;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dxton (wrapper)", 0);
  assert(__pyx_arg_dx); {
    __pyx_v_dx = __pyx_PyFloat_AsDouble(__pyx_arg_dx); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 695, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.dxton", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_4dxton(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), ((double)__pyx_v_dx));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_4dxton(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_dx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dxton", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4bpf4_4core_12BpfInterface_dxton(__pyx_v_self, __pyx_v_dx, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.dxton", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":717
 *         return <int>(((self._x1 + dx) - self._x0) / dx)
 * 
 *     def bounds(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple (xstart, xend) representing the bounds of this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_7bounds(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_6bounds[] = "BpfInterface.bounds(self)\n\n        Returns a tuple (xstart, xend) representing the bounds of this bpf\n\n        Returns:\n            (tuple[float, float]) The bounbs of this bpf\n\n        The returned bounds indicate the range within which this bpf is defined, but\n        any bpf can be evaluated outside those bounds. In such a case the out-of-bound\n        result will depend on the concrete subclass being evaluated. For most cases\n        the out-of-bound result is the same as the result at the bounds\n\n        ## Example\n        \n        ```python\n\n        >>> from bpf4 import *\n        >>> a = linear(1, 10, 2, 25)\n        >>> a.bounds()\n        (1.0, 2.0)\n        ```\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_7bounds = {"bounds", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_7bounds, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_6bounds};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_7bounds(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bounds (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_6bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_6bounds(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bounds", 0);

  /* "bpf4/core.pyx":740
 * 
 *         """
 *         return self._x0, self._x1             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_x0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->_x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":717
 *         return <int>(((self._x1 + dx) - self._x0) / dx)
 * 
 *     def bounds(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple (xstart, xend) representing the bounds of this bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":743
 * 
 *     @property
 *     def x0(self) -> float:             # <<<<<<<<<<<<<<
 *         """The lower bound of the x coordinate"""
 *         return self._x0
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_2x0_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_2x0_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_2x0___get__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_2x0___get__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bpf4/core.pyx":745
 *     def x0(self) -> float:
 *         """The lower bound of the x coordinate"""
 *         return self._x0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_x0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":743
 * 
 *     @property
 *     def x0(self) -> float:             # <<<<<<<<<<<<<<
 *         """The lower bound of the x coordinate"""
 *         return self._x0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.x0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":749
 * 
 *     @property
 *     def x1(self) -> float:             # <<<<<<<<<<<<<<
 *         """The upper bound of the x coordinate"""
 *         return self._x1
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_2x1_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_2x1_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_2x1___get__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_2x1___get__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bpf4/core.pyx":751
 *     def x1(self) -> float:
 *         """The upper bound of the x coordinate"""
 *         return self._x1             # <<<<<<<<<<<<<<
 * 
 *     def __add__(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_x1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":749
 * 
 *     @property
 *     def x1(self) -> float:             # <<<<<<<<<<<<<<
 *         """The upper bound of the x coordinate"""
 *         return self._x1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.x1.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":753
 *         return self._x1
 * 
 *     def __add__(a, b):             # <<<<<<<<<<<<<<
 *         return _create_lambda_unordered(a, b, _BpfLambdaAdd, _BpfLambdaAddConst)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_9__add__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_9__add__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_8__add__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_8__add__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__add__", 0);

  /* "bpf4/core.pyx":754
 * 
 *     def __add__(a, b):
 *         return _create_lambda_unordered(a, b, _BpfLambdaAdd, _BpfLambdaAddConst)             # <<<<<<<<<<<<<<
 * 
 *     def __sub__(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4bpf4_4core__create_lambda_unordered(__pyx_v_a, __pyx_v_b, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaAdd), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaAddConst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":753
 *         return self._x1
 * 
 *     def __add__(a, b):             # <<<<<<<<<<<<<<
 *         return _create_lambda_unordered(a, b, _BpfLambdaAdd, _BpfLambdaAddConst)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":756
 *         return _create_lambda_unordered(a, b, _BpfLambdaAdd, _BpfLambdaAddConst)
 * 
 *     def __sub__(a, b):             # <<<<<<<<<<<<<<
 *         return _create_rlambda(a, b, _BpfLambdaSub, _BpfLambdaSubConst, _BpfLambdaRSub, _BpfLambdaRSubConst)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_11__sub__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_11__sub__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_10__sub__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_10__sub__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core__create_rlambda __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__sub__", 0);

  /* "bpf4/core.pyx":757
 * 
 *     def __sub__(a, b):
 *         return _create_rlambda(a, b, _BpfLambdaSub, _BpfLambdaSubConst, _BpfLambdaRSub, _BpfLambdaRSubConst)             # <<<<<<<<<<<<<<
 * 
 *     def __mul__(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.class_rbin = ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRSub);
  __pyx_t_2.class_rconst = ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRSubConst);
  __pyx_t_1 = __pyx_f_4bpf4_4core__create_rlambda(__pyx_v_a, __pyx_v_b, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaSub), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaSubConst), &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":756
 *         return _create_lambda_unordered(a, b, _BpfLambdaAdd, _BpfLambdaAddConst)
 * 
 *     def __sub__(a, b):             # <<<<<<<<<<<<<<
 *         return _create_rlambda(a, b, _BpfLambdaSub, _BpfLambdaSubConst, _BpfLambdaRSub, _BpfLambdaRSubConst)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":759
 *         return _create_rlambda(a, b, _BpfLambdaSub, _BpfLambdaSubConst, _BpfLambdaRSub, _BpfLambdaRSubConst)
 * 
 *     def __mul__(a, b):             # <<<<<<<<<<<<<<
 *         cdef float v
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_13__mul__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_13__mul__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_12__mul__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_12__mul__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  float __pyx_v_v;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  double __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__mul__", 0);

  /* "bpf4/core.pyx":761
 *     def __mul__(a, b):
 *         cdef float v
 *         try:             # <<<<<<<<<<<<<<
 *             v = float(b)  # are we a?
 *             if v == 0:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "bpf4/core.pyx":762
 *         cdef float v
 *         try:
 *             v = float(b)  # are we a?             # <<<<<<<<<<<<<<
 *             if v == 0:
 *                 return Const(0).set_bounds(a.x0, a.x1)
 */
      __pyx_t_4 = __Pyx_PyObject_AsDouble(__pyx_v_b); if (unlikely(__pyx_t_4 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L3_error)
      __pyx_v_v = __pyx_t_4;

      /* "bpf4/core.pyx":763
 *         try:
 *             v = float(b)  # are we a?
 *             if v == 0:             # <<<<<<<<<<<<<<
 *                 return Const(0).set_bounds(a.x0, a.x1)
 *             elif v == 1:
 */
      __pyx_t_5 = ((__pyx_v_v == 0.0) != 0);
      if (__pyx_t_5) {

        /* "bpf4/core.pyx":764
 *             v = float(b)  # are we a?
 *             if v == 0:
 *                 return Const(0).set_bounds(a.x0, a.x1)             # <<<<<<<<<<<<<<
 *             elif v == 1:
 *                 return a
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Const), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 764, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_set_bounds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 764, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_x0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 764, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_x1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 764, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        __pyx_t_11 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
            __pyx_t_11 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_7, __pyx_t_9};
          __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 764, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_7, __pyx_t_9};
          __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 764, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 764, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_10) {
            __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_9);
          __pyx_t_7 = 0;
          __pyx_t_9 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 764, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L7_try_return;

        /* "bpf4/core.pyx":763
 *         try:
 *             v = float(b)  # are we a?
 *             if v == 0:             # <<<<<<<<<<<<<<
 *                 return Const(0).set_bounds(a.x0, a.x1)
 *             elif v == 1:
 */
      }

      /* "bpf4/core.pyx":765
 *             if v == 0:
 *                 return Const(0).set_bounds(a.x0, a.x1)
 *             elif v == 1:             # <<<<<<<<<<<<<<
 *                 return a
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_v == 1.0) != 0);
      if (__pyx_t_5) {

        /* "bpf4/core.pyx":766
 *                 return Const(0).set_bounds(a.x0, a.x1)
 *             elif v == 1:
 *                 return a             # <<<<<<<<<<<<<<
 *             else:
 *                 return _BpfLambdaMulConst(a, b, a.bounds())
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_a);
        __pyx_r = __pyx_v_a;
        goto __pyx_L7_try_return;

        /* "bpf4/core.pyx":765
 *             if v == 0:
 *                 return Const(0).set_bounds(a.x0, a.x1)
 *             elif v == 1:             # <<<<<<<<<<<<<<
 *                 return a
 *             else:
 */
      }

      /* "bpf4/core.pyx":768
 *                 return a
 *             else:
 *                 return _BpfLambdaMulConst(a, b, a.bounds())             # <<<<<<<<<<<<<<
 *         except (TypeError, ValueError):
 *             try:
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_bounds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 768, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 768, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 768, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_a);
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_b);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaMulConst), __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 768, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L7_try_return;
      }

      /* "bpf4/core.pyx":761
 *     def __mul__(a, b):
 *         cdef float v
 *         try:             # <<<<<<<<<<<<<<
 *             v = float(b)  # are we a?
 *             if v == 0:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "bpf4/core.pyx":769
 *             else:
 *                 return _BpfLambdaMulConst(a, b, a.bounds())
 *         except (TypeError, ValueError):             # <<<<<<<<<<<<<<
 *             try:
 *                 v = float(a) # are we b?
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("bpf4.core.BpfInterface.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_12) < 0) __PYX_ERR(0, 769, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_12);

      /* "bpf4/core.pyx":770
 *                 return _BpfLambdaMulConst(a, b, a.bounds())
 *         except (TypeError, ValueError):
 *             try:             # <<<<<<<<<<<<<<
 *                 v = float(a) # are we b?
 *                 if v == 0:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_15);
        /*try:*/ {

          /* "bpf4/core.pyx":771
 *         except (TypeError, ValueError):
 *             try:
 *                 v = float(a) # are we b?             # <<<<<<<<<<<<<<
 *                 if v == 0:
 *                     return Const(0).set_bounds(b.x0, b.x1)
 */
          __pyx_t_4 = __Pyx_PyObject_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_4 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 771, __pyx_L12_error)
          __pyx_v_v = __pyx_t_4;

          /* "bpf4/core.pyx":772
 *             try:
 *                 v = float(a) # are we b?
 *                 if v == 0:             # <<<<<<<<<<<<<<
 *                     return Const(0).set_bounds(b.x0, b.x1)
 *                 elif v == 1:
 */
          __pyx_t_5 = ((__pyx_v_v == 0.0) != 0);
          if (__pyx_t_5) {

            /* "bpf4/core.pyx":773
 *                 v = float(a) # are we b?
 *                 if v == 0:
 *                     return Const(0).set_bounds(b.x0, b.x1)             # <<<<<<<<<<<<<<
 *                 elif v == 1:
 *                     return b
 */
            __Pyx_XDECREF(__pyx_r);
            __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Const), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 773, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_set_bounds); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 773, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_x0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 773, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_x1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 773, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_17 = NULL;
            __pyx_t_11 = 0;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
              __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_10);
              if (likely(__pyx_t_17)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
                __Pyx_INCREF(__pyx_t_17);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_10, function);
                __pyx_t_11 = 1;
              }
            }
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(__pyx_t_10)) {
              PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_7, __pyx_t_16};
              __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 773, __pyx_L12_error)
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            } else
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
              PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_7, __pyx_t_16};
              __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 773, __pyx_L12_error)
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            } else
            #endif
            {
              __pyx_t_18 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 773, __pyx_L12_error)
              __Pyx_GOTREF(__pyx_t_18);
              if (__pyx_t_17) {
                __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17); __pyx_t_17 = NULL;
              }
              __Pyx_GIVEREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_11, __pyx_t_7);
              __Pyx_GIVEREF(__pyx_t_16);
              PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_11, __pyx_t_16);
              __pyx_t_7 = 0;
              __pyx_t_16 = 0;
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_18, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 773, __pyx_L12_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            }
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_r = __pyx_t_9;
            __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L16_try_return;

            /* "bpf4/core.pyx":772
 *             try:
 *                 v = float(a) # are we b?
 *                 if v == 0:             # <<<<<<<<<<<<<<
 *                     return Const(0).set_bounds(b.x0, b.x1)
 *                 elif v == 1:
 */
          }

          /* "bpf4/core.pyx":774
 *                 if v == 0:
 *                     return Const(0).set_bounds(b.x0, b.x1)
 *                 elif v == 1:             # <<<<<<<<<<<<<<
 *                     return b
 *                 else:
 */
          __pyx_t_5 = ((__pyx_v_v == 1.0) != 0);
          if (__pyx_t_5) {

            /* "bpf4/core.pyx":775
 *                     return Const(0).set_bounds(b.x0, b.x1)
 *                 elif v == 1:
 *                     return b             # <<<<<<<<<<<<<<
 *                 else:
 *                     return _BpfLambdaMulConst(b, a, b.bounds())
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(__pyx_v_b);
            __pyx_r = __pyx_v_b;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L16_try_return;

            /* "bpf4/core.pyx":774
 *                 if v == 0:
 *                     return Const(0).set_bounds(b.x0, b.x1)
 *                 elif v == 1:             # <<<<<<<<<<<<<<
 *                     return b
 *                 else:
 */
          }

          /* "bpf4/core.pyx":777
 *                     return b
 *                 else:
 *                     return _BpfLambdaMulConst(b, a, b.bounds())             # <<<<<<<<<<<<<<
 *             except (TypeError, ValueError):
 *                 return _create_lambda_unordered(a, b, _BpfLambdaMul, _BpfLambdaMulConst)  # two bpfs
 */
          /*else*/ {
            __Pyx_XDECREF(__pyx_r);
            __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_bounds); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 777, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_18 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
              __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_10);
              if (likely(__pyx_t_18)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
                __Pyx_INCREF(__pyx_t_18);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_10, function);
              }
            }
            __pyx_t_9 = (__pyx_t_18) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_18) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
            __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 777, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 777, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_INCREF(__pyx_v_b);
            __Pyx_GIVEREF(__pyx_v_b);
            PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_b);
            __Pyx_INCREF(__pyx_v_a);
            __Pyx_GIVEREF(__pyx_v_a);
            PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_a);
            __Pyx_GIVEREF(__pyx_t_9);
            PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9);
            __pyx_t_9 = 0;
            __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaMulConst), __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 777, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_r = __pyx_t_9;
            __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L16_try_return;
          }

          /* "bpf4/core.pyx":770
 *                 return _BpfLambdaMulConst(a, b, a.bounds())
 *         except (TypeError, ValueError):
 *             try:             # <<<<<<<<<<<<<<
 *                 v = float(a) # are we b?
 *                 if v == 0:
 */
        }
        __pyx_L12_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "bpf4/core.pyx":778
 *                 else:
 *                     return _BpfLambdaMulConst(b, a, b.bounds())
 *             except (TypeError, ValueError):             # <<<<<<<<<<<<<<
 *                 return _create_lambda_unordered(a, b, _BpfLambdaMul, _BpfLambdaMulConst)  # two bpfs
 * 
 */
        __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
        if (__pyx_t_11) {
          __Pyx_AddTraceback("bpf4.core.BpfInterface.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_18) < 0) __PYX_ERR(0, 778, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GOTREF(__pyx_t_18);

          /* "bpf4/core.pyx":779
 *                     return _BpfLambdaMulConst(b, a, b.bounds())
 *             except (TypeError, ValueError):
 *                 return _create_lambda_unordered(a, b, _BpfLambdaMul, _BpfLambdaMulConst)  # two bpfs             # <<<<<<<<<<<<<<
 * 
 *     def __div__(a, b):
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_16 = __pyx_f_4bpf4_4core__create_lambda_unordered(__pyx_v_a, __pyx_v_b, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaMul), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaMulConst)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 779, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_r = __pyx_t_16;
          __pyx_t_16 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          goto __pyx_L15_except_return;
        }
        goto __pyx_L14_except_error;
        __pyx_L14_except_error:;

        /* "bpf4/core.pyx":770
 *                 return _BpfLambdaMulConst(a, b, a.bounds())
 *         except (TypeError, ValueError):
 *             try:             # <<<<<<<<<<<<<<
 *                 v = float(a) # are we b?
 *                 if v == 0:
 */
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        goto __pyx_L5_except_error;
        __pyx_L16_try_return:;
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        goto __pyx_L6_except_return;
        __pyx_L15_except_return:;
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        goto __pyx_L6_except_return;
      }
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "bpf4/core.pyx":761
 *     def __mul__(a, b):
 *         cdef float v
 *         try:             # <<<<<<<<<<<<<<
 *             v = float(b)  # are we a?
 *             if v == 0:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":759
 *         return _create_rlambda(a, b, _BpfLambdaSub, _BpfLambdaSubConst, _BpfLambdaRSub, _BpfLambdaRSubConst)
 * 
 *     def __mul__(a, b):             # <<<<<<<<<<<<<<
 *         cdef float v
 *         try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":781
 *                 return _create_lambda_unordered(a, b, _BpfLambdaMul, _BpfLambdaMulConst)  # two bpfs
 * 
 *     def __div__(a, b):             # <<<<<<<<<<<<<<
 *         cdef float v
 *         try:
 */

/* Python wrapper */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_15__div__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_15__div__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_14__div__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/

#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_14__div__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  float __pyx_v_v;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  double __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  struct __pyx_opt_args_4bpf4_4core__create_rlambda __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__div__", 0);

  /* "bpf4/core.pyx":783
 *     def __div__(a, b):
 *         cdef float v
 *         try:             # <<<<<<<<<<<<<<
 *             v = float(b)  # are we a?
 *             if v == 0:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "bpf4/core.pyx":784
 *         cdef float v
 *         try:
 *             v = float(b)  # are we a?             # <<<<<<<<<<<<<<
 *             if v == 0:
 *                 raise ZeroDivisionError("Can't divide by 0")
 */
      __pyx_t_4 = __Pyx_PyObject_AsDouble(__pyx_v_b); if (unlikely(__pyx_t_4 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 784, __pyx_L3_error)
      __pyx_v_v = __pyx_t_4;

      /* "bpf4/core.pyx":785
 *         try:
 *             v = float(b)  # are we a?
 *             if v == 0:             # <<<<<<<<<<<<<<
 *                 raise ZeroDivisionError("Can't divide by 0")
 *             elif v == 1:
 */
      __pyx_t_5 = ((__pyx_v_v == 0.0) != 0);
      if (unlikely(__pyx_t_5)) {

        /* "bpf4/core.pyx":786
 *             v = float(b)  # are we a?
 *             if v == 0:
 *                 raise ZeroDivisionError("Can't divide by 0")             # <<<<<<<<<<<<<<
 *             elif v == 1:
 *                 return a
 */
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 786, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(0, 786, __pyx_L3_error)

        /* "bpf4/core.pyx":785
 *         try:
 *             v = float(b)  # are we a?
 *             if v == 0:             # <<<<<<<<<<<<<<
 *                 raise ZeroDivisionError("Can't divide by 0")
 *             elif v == 1:
 */
      }

      /* "bpf4/core.pyx":787
 *             if v == 0:
 *                 raise ZeroDivisionError("Can't divide by 0")
 *             elif v == 1:             # <<<<<<<<<<<<<<
 *                 return a
 *             else:
 */
      __pyx_t_5 = ((__pyx_v_v == 1.0) != 0);
      if (__pyx_t_5) {

        /* "bpf4/core.pyx":788
 *                 raise ZeroDivisionError("Can't divide by 0")
 *             elif v == 1:
 *                 return a             # <<<<<<<<<<<<<<
 *             else:
 *                 return _BpfLambdaDivConst(a, b, a.bounds())
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_a);
        __pyx_r = __pyx_v_a;
        goto __pyx_L7_try_return;

        /* "bpf4/core.pyx":787
 *             if v == 0:
 *                 raise ZeroDivisionError("Can't divide by 0")
 *             elif v == 1:             # <<<<<<<<<<<<<<
 *                 return a
 *             else:
 */
      }

      /* "bpf4/core.pyx":790
 *                 return a
 *             else:
 *                 return _BpfLambdaDivConst(a, b, a.bounds())             # <<<<<<<<<<<<<<
 *         except (TypeError, ValueError):
 *             try:
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_bounds); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 790, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 790, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 790, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_a);
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_b);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaDivConst), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 790, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L7_try_return;
      }

      /* "bpf4/core.pyx":783
 *     def __div__(a, b):
 *         cdef float v
 *         try:             # <<<<<<<<<<<<<<
 *             v = float(b)  # are we a?
 *             if v == 0:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "bpf4/core.pyx":791
 *             else:
 *                 return _BpfLambdaDivConst(a, b, a.bounds())
 *         except (TypeError, ValueError):             # <<<<<<<<<<<<<<
 *             try:
 *                 v = float(a) # are we b?
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("bpf4.core.BpfInterface.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 791, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "bpf4/core.pyx":792
 *                 return _BpfLambdaDivConst(a, b, a.bounds())
 *         except (TypeError, ValueError):
 *             try:             # <<<<<<<<<<<<<<
 *                 v = float(a) # are we b?
 *                 if v == 0:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        /*try:*/ {

          /* "bpf4/core.pyx":793
 *         except (TypeError, ValueError):
 *             try:
 *                 v = float(a) # are we b?             # <<<<<<<<<<<<<<
 *                 if v == 0:
 *                     return 0
 */
          __pyx_t_4 = __Pyx_PyObject_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_4 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 793, __pyx_L12_error)
          __pyx_v_v = __pyx_t_4;

          /* "bpf4/core.pyx":794
 *             try:
 *                 v = float(a) # are we b?
 *                 if v == 0:             # <<<<<<<<<<<<<<
 *                     return 0
 *                 else:
 */
          __pyx_t_5 = ((__pyx_v_v == 0.0) != 0);
          if (__pyx_t_5) {

            /* "bpf4/core.pyx":795
 *                 v = float(a) # are we b?
 *                 if v == 0:
 *                     return 0             # <<<<<<<<<<<<<<
 *                 else:
 *                     return _BpfLambdaRDivConst(b, a, b.bounds())
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(__pyx_int_0);
            __pyx_r = __pyx_int_0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            goto __pyx_L16_try_return;

            /* "bpf4/core.pyx":794
 *             try:
 *                 v = float(a) # are we b?
 *                 if v == 0:             # <<<<<<<<<<<<<<
 *                     return 0
 *                 else:
 */
          }

          /* "bpf4/core.pyx":797
 *                     return 0
 *                 else:
 *                     return _BpfLambdaRDivConst(b, a, b.bounds())             # <<<<<<<<<<<<<<
 *             except (TypeError, ValueError):
 *                 return _create_rlambda(a, b, _BpfLambdaDiv, _BpfLambdaDivConst, _BpfLambdaRDiv, _BpfLambdaRDivConst)
 */
          /*else*/ {
            __Pyx_XDECREF(__pyx_r);
            __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_bounds); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 797, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_15 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
              __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
              if (likely(__pyx_t_15)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
                __Pyx_INCREF(__pyx_t_15);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_14, function);
              }
            }
            __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 797, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 797, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_INCREF(__pyx_v_b);
            __Pyx_GIVEREF(__pyx_v_b);
            PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_b);
            __Pyx_INCREF(__pyx_v_a);
            __Pyx_GIVEREF(__pyx_v_a);
            PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_a);
            __Pyx_GIVEREF(__pyx_t_13);
            PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_13);
            __pyx_t_13 = 0;
            __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRDivConst), __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 797, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_r = __pyx_t_13;
            __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            goto __pyx_L16_try_return;
          }

          /* "bpf4/core.pyx":792
 *                 return _BpfLambdaDivConst(a, b, a.bounds())
 *         except (TypeError, ValueError):
 *             try:             # <<<<<<<<<<<<<<
 *                 v = float(a) # are we b?
 *                 if v == 0:
 */
        }
        __pyx_L12_error:;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;

        /* "bpf4/core.pyx":798
 *                 else:
 *                     return _BpfLambdaRDivConst(b, a, b.bounds())
 *             except (TypeError, ValueError):             # <<<<<<<<<<<<<<
 *                 return _create_rlambda(a, b, _BpfLambdaDiv, _BpfLambdaDivConst, _BpfLambdaRDiv, _BpfLambdaRDivConst)
 * 
 */
        __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
        if (__pyx_t_9) {
          __Pyx_AddTraceback("bpf4.core.BpfInterface.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0) __PYX_ERR(0, 798, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GOTREF(__pyx_t_15);

          /* "bpf4/core.pyx":799
 *                     return _BpfLambdaRDivConst(b, a, b.bounds())
 *             except (TypeError, ValueError):
 *                 return _create_rlambda(a, b, _BpfLambdaDiv, _BpfLambdaDivConst, _BpfLambdaRDiv, _BpfLambdaRDivConst)             # <<<<<<<<<<<<<<
 * 
 *     def __truediv__(a, b):
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_17.__pyx_n = 2;
          __pyx_t_17.class_rbin = ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRDiv);
          __pyx_t_17.class_rconst = ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRDivConst);
          __pyx_t_16 = __pyx_f_4bpf4_4core__create_rlambda(__pyx_v_a, __pyx_v_b, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaDiv), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaDivConst), &__pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 799, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_r = __pyx_t_16;
          __pyx_t_16 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          goto __pyx_L15_except_return;
        }
        goto __pyx_L14_except_error;
        __pyx_L14_except_error:;

        /* "bpf4/core.pyx":792
 *                 return _BpfLambdaDivConst(a, b, a.bounds())
 *         except (TypeError, ValueError):
 *             try:             # <<<<<<<<<<<<<<
 *                 v = float(a) # are we b?
 *                 if v == 0:
 */
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L5_except_error;
        __pyx_L16_try_return:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L6_except_return;
        __pyx_L15_except_return:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L6_except_return;
      }
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "bpf4/core.pyx":783
 *     def __div__(a, b):
 *         cdef float v
 *         try:             # <<<<<<<<<<<<<<
 *             v = float(b)  # are we a?
 *             if v == 0:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":781
 *                 return _create_lambda_unordered(a, b, _BpfLambdaMul, _BpfLambdaMulConst)  # two bpfs
 * 
 *     def __div__(a, b):             # <<<<<<<<<<<<<<
 *         cdef float v
 *         try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/

/* "bpf4/core.pyx":801
 *                 return _create_rlambda(a, b, _BpfLambdaDiv, _BpfLambdaDivConst, _BpfLambdaRDiv, _BpfLambdaRDivConst)
 * 
 *     def __truediv__(a, b):             # <<<<<<<<<<<<<<
 *         return _create_rlambda(a, b, _BpfLambdaDiv, _BpfLambdaDivConst, _BpfLambdaRDiv, _BpfLambdaRDivConst)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_17__truediv__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_17__truediv__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_16__truediv__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_16__truediv__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core__create_rlambda __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__truediv__", 0);

  /* "bpf4/core.pyx":802
 * 
 *     def __truediv__(a, b):
 *         return _create_rlambda(a, b, _BpfLambdaDiv, _BpfLambdaDivConst, _BpfLambdaRDiv, _BpfLambdaRDivConst)             # <<<<<<<<<<<<<<
 * 
 *     def __pow__(a, b, modulo):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.class_rbin = ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRDiv);
  __pyx_t_2.class_rconst = ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRDivConst);
  __pyx_t_1 = __pyx_f_4bpf4_4core__create_rlambda(__pyx_v_a, __pyx_v_b, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaDiv), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaDivConst), &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":801
 *                 return _create_rlambda(a, b, _BpfLambdaDiv, _BpfLambdaDivConst, _BpfLambdaRDiv, _BpfLambdaRDivConst)
 * 
 *     def __truediv__(a, b):             # <<<<<<<<<<<<<<
 *         return _create_rlambda(a, b, _BpfLambdaDiv, _BpfLambdaDivConst, _BpfLambdaRDiv, _BpfLambdaRDivConst)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":804
 *         return _create_rlambda(a, b, _BpfLambdaDiv, _BpfLambdaDivConst, _BpfLambdaRDiv, _BpfLambdaRDivConst)
 * 
 *     def __pow__(a, b, modulo):             # <<<<<<<<<<<<<<
 *         cdef double tmp
 *         if isinstance(a, BpfInterface):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_19__pow__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_modulo); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_19__pow__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_modulo) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pow__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_18__pow__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b), ((PyObject *)__pyx_v_modulo));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_18__pow__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, CYTHON_UNUSED PyObject *__pyx_v_modulo) {
  double __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  double __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pow__", 0);

  /* "bpf4/core.pyx":806
 *     def __pow__(a, b, modulo):
 *         cdef double tmp
 *         if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *             if isinstance(b, BpfInterface):
 *                 return _BpfLambdaPow(a, b, _get_bounds(a, b))
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":807
 *         cdef double tmp
 *         if isinstance(a, BpfInterface):
 *             if isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *                 return _BpfLambdaPow(a, b, _get_bounds(a, b))
 *             elif callable(b):
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_4bpf4_4core_BpfInterface); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":808
 *         if isinstance(a, BpfInterface):
 *             if isinstance(b, BpfInterface):
 *                 return _BpfLambdaPow(a, b, _get_bounds(a, b))             # <<<<<<<<<<<<<<
 *             elif callable(b):
 *                 return _BpfLambdaPow(a, _FunctionWrap(b), a.bounds())
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_bounds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_a, __pyx_v_b};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_a, __pyx_v_b};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 808, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_a);
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_b);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_a);
      __Pyx_GIVEREF(__pyx_v_a);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_a);
      __Pyx_INCREF(__pyx_v_b);
      __Pyx_GIVEREF(__pyx_v_b);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_b);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaPow), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":807
 *         cdef double tmp
 *         if isinstance(a, BpfInterface):
 *             if isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *                 return _BpfLambdaPow(a, b, _get_bounds(a, b))
 *             elif callable(b):
 */
    }

    /* "bpf4/core.pyx":809
 *             if isinstance(b, BpfInterface):
 *                 return _BpfLambdaPow(a, b, _get_bounds(a, b))
 *             elif callable(b):             # <<<<<<<<<<<<<<
 *                 return _BpfLambdaPow(a, _FunctionWrap(b), a.bounds())
 *             elif b == 2:
 */
    __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_b); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 809, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":810
 *                 return _BpfLambdaPow(a, b, _get_bounds(a, b))
 *             elif callable(b):
 *                 return _BpfLambdaPow(a, _FunctionWrap(b), a.bounds())             # <<<<<<<<<<<<<<
 *             elif b == 2:
 *                 return a*a
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FunctionWrap); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_b) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_b);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 810, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_bounds); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 810, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 810, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_a);
      __Pyx_GIVEREF(__pyx_v_a);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_a);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaPow), __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":809
 *             if isinstance(b, BpfInterface):
 *                 return _BpfLambdaPow(a, b, _get_bounds(a, b))
 *             elif callable(b):             # <<<<<<<<<<<<<<
 *                 return _BpfLambdaPow(a, _FunctionWrap(b), a.bounds())
 *             elif b == 2:
 */
    }

    /* "bpf4/core.pyx":811
 *             elif callable(b):
 *                 return _BpfLambdaPow(a, _FunctionWrap(b), a.bounds())
 *             elif b == 2:             # <<<<<<<<<<<<<<
 *                 return a*a
 *             elif b == 3:
 */
    __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_b, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":812
 *                 return _BpfLambdaPow(a, _FunctionWrap(b), a.bounds())
 *             elif b == 2:
 *                 return a*a             # <<<<<<<<<<<<<<
 *             elif b == 3:
 *                 return a*a*a
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = PyNumber_Multiply(__pyx_v_a, __pyx_v_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 812, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":811
 *             elif callable(b):
 *                 return _BpfLambdaPow(a, _FunctionWrap(b), a.bounds())
 *             elif b == 2:             # <<<<<<<<<<<<<<
 *                 return a*a
 *             elif b == 3:
 */
    }

    /* "bpf4/core.pyx":813
 *             elif b == 2:
 *                 return a*a
 *             elif b == 3:             # <<<<<<<<<<<<<<
 *                 return a*a*a
 *             elif b == 4:
 */
    __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_b, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 813, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":814
 *                 return a*a
 *             elif b == 3:
 *                 return a*a*a             # <<<<<<<<<<<<<<
 *             elif b == 4:
 *                 tmp = a*a
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = PyNumber_Multiply(__pyx_v_a, __pyx_v_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 814, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_v_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 814, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":813
 *             elif b == 2:
 *                 return a*a
 *             elif b == 3:             # <<<<<<<<<<<<<<
 *                 return a*a*a
 *             elif b == 4:
 */
    }

    /* "bpf4/core.pyx":815
 *             elif b == 3:
 *                 return a*a*a
 *             elif b == 4:             # <<<<<<<<<<<<<<
 *                 tmp = a*a
 *                 return tmp*tmp
 */
    __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_v_b, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 815, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":816
 *                 return a*a*a
 *             elif b == 4:
 *                 tmp = a*a             # <<<<<<<<<<<<<<
 *                 return tmp*tmp
 *             elif b == 0:
 */
      __pyx_t_7 = PyNumber_Multiply(__pyx_v_a, __pyx_v_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 816, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_tmp = __pyx_t_8;

      /* "bpf4/core.pyx":817
 *             elif b == 4:
 *                 tmp = a*a
 *                 return tmp*tmp             # <<<<<<<<<<<<<<
 *             elif b == 0:
 *                 return a
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_7 = PyFloat_FromDouble((__pyx_v_tmp * __pyx_v_tmp)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_r = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":815
 *             elif b == 3:
 *                 return a*a*a
 *             elif b == 4:             # <<<<<<<<<<<<<<
 *                 tmp = a*a
 *                 return tmp*tmp
 */
    }

    /* "bpf4/core.pyx":818
 *                 tmp = a*a
 *                 return tmp*tmp
 *             elif b == 0:             # <<<<<<<<<<<<<<
 *                 return a
 *             elif b == -1:
 */
    __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_v_b, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 818, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":819
 *                 return tmp*tmp
 *             elif b == 0:
 *                 return a             # <<<<<<<<<<<<<<
 *             elif b == -1:
 *                 return 1/a
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_a);
      __pyx_r = __pyx_v_a;
      goto __pyx_L0;

      /* "bpf4/core.pyx":818
 *                 tmp = a*a
 *                 return tmp*tmp
 *             elif b == 0:             # <<<<<<<<<<<<<<
 *                 return a
 *             elif b == -1:
 */
    }

    /* "bpf4/core.pyx":820
 *             elif b == 0:
 *                 return a
 *             elif b == -1:             # <<<<<<<<<<<<<<
 *                 return 1/a
 *             elif b == -2:
 */
    __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_v_b, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 820, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":821
 *                 return a
 *             elif b == -1:
 *                 return 1/a             # <<<<<<<<<<<<<<
 *             elif b == -2:
 *                 return 1/(a*a)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_v_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_r = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":820
 *             elif b == 0:
 *                 return a
 *             elif b == -1:             # <<<<<<<<<<<<<<
 *                 return 1/a
 *             elif b == -2:
 */
    }

    /* "bpf4/core.pyx":822
 *             elif b == -1:
 *                 return 1/a
 *             elif b == -2:             # <<<<<<<<<<<<<<
 *                 return 1/(a*a)
 *             else:
 */
    __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_v_b, __pyx_int_neg_2, -2L, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 822, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":823
 *                 return 1/a
 *             elif b == -2:
 *                 return 1/(a*a)             # <<<<<<<<<<<<<<
 *             else:
 *                 return _BpfLambdaPowConst(a, b, a.bounds())
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_7 = PyNumber_Multiply(__pyx_v_a, __pyx_v_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 823, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 823, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":822
 *             elif b == -1:
 *                 return 1/a
 *             elif b == -2:             # <<<<<<<<<<<<<<
 *                 return 1/(a*a)
 *             else:
 */
    }

    /* "bpf4/core.pyx":825
 *                 return 1/(a*a)
 *             else:
 *                 return _BpfLambdaPowConst(a, b, a.bounds())             # <<<<<<<<<<<<<<
 *         elif isinstance(b, BpfInterface):
 *             if callable(a):
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_bounds); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_a);
      __Pyx_GIVEREF(__pyx_v_a);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_a);
      __Pyx_INCREF(__pyx_v_b);
      __Pyx_GIVEREF(__pyx_v_b);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_b);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaPowConst), __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }

    /* "bpf4/core.pyx":806
 *     def __pow__(a, b, modulo):
 *         cdef double tmp
 *         if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *             if isinstance(b, BpfInterface):
 *                 return _BpfLambdaPow(a, b, _get_bounds(a, b))
 */
  }

  /* "bpf4/core.pyx":826
 *             else:
 *                 return _BpfLambdaPowConst(a, b, a.bounds())
 *         elif isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             if callable(a):
 *                 return _BpfLambdaPow(_FunctionWrap(a), b, b.bounds())
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":827
 *                 return _BpfLambdaPowConst(a, b, a.bounds())
 *         elif isinstance(b, BpfInterface):
 *             if callable(a):             # <<<<<<<<<<<<<<
 *                 return _BpfLambdaPow(_FunctionWrap(a), b, b.bounds())
 *             return _BpfLambdaRPowConst(b, a, (INFNEG, INF))
 */
    __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_a); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 827, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":828
 *         elif isinstance(b, BpfInterface):
 *             if callable(a):
 *                 return _BpfLambdaPow(_FunctionWrap(a), b, b.bounds())             # <<<<<<<<<<<<<<
 *             return _BpfLambdaRPowConst(b, a, (INFNEG, INF))
 *         return NotImplemented
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_FunctionWrap); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_v_a) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_a);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_bounds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_INCREF(__pyx_v_b);
      __Pyx_GIVEREF(__pyx_v_b);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_b);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_7);
      __pyx_t_4 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaPow), __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":827
 *                 return _BpfLambdaPowConst(a, b, a.bounds())
 *         elif isinstance(b, BpfInterface):
 *             if callable(a):             # <<<<<<<<<<<<<<
 *                 return _BpfLambdaPow(_FunctionWrap(a), b, b.bounds())
 *             return _BpfLambdaRPowConst(b, a, (INFNEG, INF))
 */
    }

    /* "bpf4/core.pyx":829
 *             if callable(a):
 *                 return _BpfLambdaPow(_FunctionWrap(a), b, b.bounds())
 *             return _BpfLambdaRPowConst(b, a, (INFNEG, INF))             # <<<<<<<<<<<<<<
 *         return NotImplemented
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_b);
    __Pyx_GIVEREF(__pyx_v_b);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_b);
    __Pyx_INCREF(__pyx_v_a);
    __Pyx_GIVEREF(__pyx_v_a);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_a);
    __Pyx_INCREF(__pyx_tuple__5);
    __Pyx_GIVEREF(__pyx_tuple__5);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_tuple__5);
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRPowConst), __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":826
 *             else:
 *                 return _BpfLambdaPowConst(a, b, a.bounds())
 *         elif isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             if callable(a):
 *                 return _BpfLambdaPow(_FunctionWrap(a), b, b.bounds())
 */
  }

  /* "bpf4/core.pyx":830
 *                 return _BpfLambdaPow(_FunctionWrap(a), b, b.bounds())
 *             return _BpfLambdaRPowConst(b, a, (INFNEG, INF))
 *         return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __neg__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_builtin_NotImplemented);
  __pyx_r = __pyx_builtin_NotImplemented;
  goto __pyx_L0;

  /* "bpf4/core.pyx":804
 *         return _create_rlambda(a, b, _BpfLambdaDiv, _BpfLambdaDivConst, _BpfLambdaRDiv, _BpfLambdaRDivConst)
 * 
 *     def __pow__(a, b, modulo):             # <<<<<<<<<<<<<<
 *         cdef double tmp
 *         if isinstance(a, BpfInterface):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":832
 *         return NotImplemented
 * 
 *     def __neg__(self):             # <<<<<<<<<<<<<<
 *         return self * -1
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_21__neg__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_21__neg__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__neg__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_20__neg__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_20__neg__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__neg__", 0);

  /* "bpf4/core.pyx":833
 * 
 *     def __neg__(self):
 *         return self * -1             # <<<<<<<<<<<<<<
 * 
 *     def __mod__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_self), __pyx_int_neg_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":832
 *         return NotImplemented
 * 
 *     def __neg__(self):             # <<<<<<<<<<<<<<
 *         return self * -1
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":835
 *         return self * -1
 * 
 *     def __mod__(self, other):             # <<<<<<<<<<<<<<
 *         return _create_lambda(self, other, _BpfLambdaMod, _BpfLambdaModConst)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_23__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_23__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mod__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_22__mod__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_22__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__mod__", 0);

  /* "bpf4/core.pyx":836
 * 
 *     def __mod__(self, other):
 *         return _create_lambda(self, other, _BpfLambdaMod, _BpfLambdaModConst)             # <<<<<<<<<<<<<<
 * 
 *     def __abs__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 836, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_4bpf4_4core__create_lambda(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_other, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaMod), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaModConst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":835
 *         return self * -1
 * 
 *     def __mod__(self, other):             # <<<<<<<<<<<<<<
 *         return _create_lambda(self, other, _BpfLambdaMod, _BpfLambdaModConst)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":838
 *         return _create_lambda(self, other, _BpfLambdaMod, _BpfLambdaModConst)
 * 
 *     def __abs__(self):             # <<<<<<<<<<<<<<
 *         return self.abs()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_25__abs__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_25__abs__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__abs__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_24__abs__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_24__abs__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__abs__", 0);

  /* "bpf4/core.pyx":839
 * 
 *     def __abs__(self):
 *         return self.abs()             # <<<<<<<<<<<<<<
 * 
 *     def __or__(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->abs(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":838
 *         return _create_lambda(self, other, _BpfLambdaMod, _BpfLambdaModConst)
 * 
 *     def __abs__(self):             # <<<<<<<<<<<<<<
 *         return self.abs()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__abs__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":841
 *         return self.abs()
 * 
 *     def __or__(a, b):             # <<<<<<<<<<<<<<
 *         """
 *         a | b
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_27__or__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_26__or__[] = "\n        a | b\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_12BpfInterface_26__or__;
#endif
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_27__or__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__or__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_26__or__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_26__or__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_v_out = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__or__", 0);

  /* "bpf4/core.pyx":845
 *         a | b
 *         """
 *         if isinstance(a, BpfInterface) and isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             out = _BpfCompose_new(a, b)
 *         elif isinstance(a, BpfInterface) and callable(b):
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":846
 *         """
 *         if isinstance(a, BpfInterface) and isinstance(b, BpfInterface):
 *             out = _BpfCompose_new(a, b)             # <<<<<<<<<<<<<<
 *         elif isinstance(a, BpfInterface) and callable(b):
 *             out = _BpfCompose_new(a, _FunctionWrap(b))
 */
    if (!(likely(((__pyx_v_a) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 846, __pyx_L1_error)
    if (!(likely(((__pyx_v_b) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_b, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 846, __pyx_L1_error)
    __pyx_t_4 = ((PyObject *)__pyx_f_4bpf4_4core__BpfCompose_new(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_a), ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_b))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 846, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_out = ((struct __pyx_obj_4bpf4_4core__BpfCompose *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "bpf4/core.pyx":845
 *         a | b
 *         """
 *         if isinstance(a, BpfInterface) and isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             out = _BpfCompose_new(a, b)
 *         elif isinstance(a, BpfInterface) and callable(b):
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":847
 *         if isinstance(a, BpfInterface) and isinstance(b, BpfInterface):
 *             out = _BpfCompose_new(a, b)
 *         elif isinstance(a, BpfInterface) and callable(b):             # <<<<<<<<<<<<<<
 *             out = _BpfCompose_new(a, _FunctionWrap(b))
 *         elif callable(a) and isinstance(b, BpfInterface):
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyCallable_Check(__pyx_v_b); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 847, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":848
 *             out = _BpfCompose_new(a, b)
 *         elif isinstance(a, BpfInterface) and callable(b):
 *             out = _BpfCompose_new(a, _FunctionWrap(b))             # <<<<<<<<<<<<<<
 *         elif callable(a) and isinstance(b, BpfInterface):
 *             out = _BpfCompose_new(_FunctionWrap(b), a)
 */
    if (!(likely(((__pyx_v_a) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FunctionWrap); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_b) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_b);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 848, __pyx_L1_error)
    __pyx_t_5 = ((PyObject *)__pyx_f_4bpf4_4core__BpfCompose_new(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_a), ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_4))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_out = ((struct __pyx_obj_4bpf4_4core__BpfCompose *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "bpf4/core.pyx":847
 *         if isinstance(a, BpfInterface) and isinstance(b, BpfInterface):
 *             out = _BpfCompose_new(a, b)
 *         elif isinstance(a, BpfInterface) and callable(b):             # <<<<<<<<<<<<<<
 *             out = _BpfCompose_new(a, _FunctionWrap(b))
 *         elif callable(a) and isinstance(b, BpfInterface):
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":849
 *         elif isinstance(a, BpfInterface) and callable(b):
 *             out = _BpfCompose_new(a, _FunctionWrap(b))
 *         elif callable(a) and isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             out = _BpfCompose_new(_FunctionWrap(b), a)
 *         else:
 */
  __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_a); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 849, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":850
 *             out = _BpfCompose_new(a, _FunctionWrap(b))
 *         elif callable(a) and isinstance(b, BpfInterface):
 *             out = _BpfCompose_new(_FunctionWrap(b), a)             # <<<<<<<<<<<<<<
 *         else:
 *             return NotImplemented
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FunctionWrap); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_b) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_b);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 850, __pyx_L1_error)
    if (!(likely(((__pyx_v_a) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 850, __pyx_L1_error)
    __pyx_t_4 = ((PyObject *)__pyx_f_4bpf4_4core__BpfCompose_new(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_5), ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_a))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_out = ((struct __pyx_obj_4bpf4_4core__BpfCompose *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "bpf4/core.pyx":849
 *         elif isinstance(a, BpfInterface) and callable(b):
 *             out = _BpfCompose_new(a, _FunctionWrap(b))
 *         elif callable(a) and isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             out = _BpfCompose_new(_FunctionWrap(b), a)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":852
 *             out = _BpfCompose_new(_FunctionWrap(b), a)
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":853
 *         else:
 *             return NotImplemented
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def __rshift__(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "bpf4/core.pyx":841
 *         return self.abs()
 * 
 *     def __or__(a, b):             # <<<<<<<<<<<<<<
 *         """
 *         a | b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":855
 *         return out
 * 
 *     def __rshift__(a, b):             # <<<<<<<<<<<<<<
 *         if isinstance(a, BpfInterface):
 *             return a.shifted(b)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_29__rshift__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_29__rshift__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__rshift__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_28__rshift__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_28__rshift__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__rshift__", 0);

  /* "bpf4/core.pyx":856
 * 
 *     def __rshift__(a, b):
 *         if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *             return a.shifted(b)
 *         return NotImplemented
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":857
 *     def __rshift__(a, b):
 *         if isinstance(a, BpfInterface):
 *             return a.shifted(b)             # <<<<<<<<<<<<<<
 *         return NotImplemented
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_shifted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_b) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_b);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":856
 * 
 *     def __rshift__(a, b):
 *         if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *             return a.shifted(b)
 *         return NotImplemented
 */
  }

  /* "bpf4/core.pyx":858
 *         if isinstance(a, BpfInterface):
 *             return a.shifted(b)
 *         return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __lshift__(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_builtin_NotImplemented);
  __pyx_r = __pyx_builtin_NotImplemented;
  goto __pyx_L0;

  /* "bpf4/core.pyx":855
 *         return out
 * 
 *     def __rshift__(a, b):             # <<<<<<<<<<<<<<
 *         if isinstance(a, BpfInterface):
 *             return a.shifted(b)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__rshift__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":860
 *         return NotImplemented
 * 
 *     def __lshift__(a, b):             # <<<<<<<<<<<<<<
 *         if isinstance(a, BpfInterface):
 *             return a.shifted(-b)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_31__lshift__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_31__lshift__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__lshift__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_30__lshift__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_30__lshift__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__lshift__", 0);

  /* "bpf4/core.pyx":861
 * 
 *     def __lshift__(a, b):
 *         if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *             return a.shifted(-b)
 *         return NotImplemented
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":862
 *     def __lshift__(a, b):
 *         if isinstance(a, BpfInterface):
 *             return a.shifted(-b)             # <<<<<<<<<<<<<<
 *         return NotImplemented
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_shifted); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Negative(__pyx_v_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":861
 * 
 *     def __lshift__(a, b):
 *         if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *             return a.shifted(-b)
 *         return NotImplemented
 */
  }

  /* "bpf4/core.pyx":863
 *         if isinstance(a, BpfInterface):
 *             return a.shifted(-b)
 *         return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __xor__(a, b): # ^
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_builtin_NotImplemented);
  __pyx_r = __pyx_builtin_NotImplemented;
  goto __pyx_L0;

  /* "bpf4/core.pyx":860
 *         return NotImplemented
 * 
 *     def __lshift__(a, b):             # <<<<<<<<<<<<<<
 *         if isinstance(a, BpfInterface):
 *             return a.shifted(-b)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__lshift__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":865
 *         return NotImplemented
 * 
 *     def __xor__(a, b): # ^             # <<<<<<<<<<<<<<
 *         if isinstance(a, BpfInterface):
 *             return a.stretched(b)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_33__xor__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_33__xor__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__xor__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_32__xor__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_32__xor__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__xor__", 0);

  /* "bpf4/core.pyx":866
 * 
 *     def __xor__(a, b): # ^
 *         if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *             return a.stretched(b)
 *         return NotImplemented
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":867
 *     def __xor__(a, b): # ^
 *         if isinstance(a, BpfInterface):
 *             return a.stretched(b)             # <<<<<<<<<<<<<<
 *         return NotImplemented
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_stretched); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_b) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_b);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":866
 * 
 *     def __xor__(a, b): # ^
 *         if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *             return a.stretched(b)
 *         return NotImplemented
 */
  }

  /* "bpf4/core.pyx":868
 *         if isinstance(a, BpfInterface):
 *             return a.stretched(b)
 *         return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(BpfInterface self, other, int t):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_builtin_NotImplemented);
  __pyx_r = __pyx_builtin_NotImplemented;
  goto __pyx_L0;

  /* "bpf4/core.pyx":865
 *         return NotImplemented
 * 
 *     def __xor__(a, b): # ^             # <<<<<<<<<<<<<<
 *         if isinstance(a, BpfInterface):
 *             return a.stretched(b)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":870
 *         return NotImplemented
 * 
 *     def __richcmp__(BpfInterface self, other, int t):             # <<<<<<<<<<<<<<
 *         if t == 0:      # <
 *             return _create_lambda(self, other, _BpfLambdaLowerThan, _BpfLambdaLowerThanConst)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_35__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_t); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_35__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_t) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_34__richcmp__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_t));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_34__richcmp__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_t) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__", 0);

  /* "bpf4/core.pyx":871
 * 
 *     def __richcmp__(BpfInterface self, other, int t):
 *         if t == 0:      # <             # <<<<<<<<<<<<<<
 *             return _create_lambda(self, other, _BpfLambdaLowerThan, _BpfLambdaLowerThanConst)
 *         elif t == 2:    # ==
 */
  switch (__pyx_v_t) {
    case 0:

    /* "bpf4/core.pyx":872
 *     def __richcmp__(BpfInterface self, other, int t):
 *         if t == 0:      # <
 *             return _create_lambda(self, other, _BpfLambdaLowerThan, _BpfLambdaLowerThanConst)             # <<<<<<<<<<<<<<
 *         elif t == 2:    # ==
 *             return _create_lambda(self, other, _BpfLambdaEqual, _BpfLambdaEqualConst)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_4bpf4_4core__create_lambda(__pyx_v_self, __pyx_v_other, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaLowerThan), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaLowerThanConst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":871
 * 
 *     def __richcmp__(BpfInterface self, other, int t):
 *         if t == 0:      # <             # <<<<<<<<<<<<<<
 *             return _create_lambda(self, other, _BpfLambdaLowerThan, _BpfLambdaLowerThanConst)
 *         elif t == 2:    # ==
 */
    break;
    case 2:

    /* "bpf4/core.pyx":874
 *             return _create_lambda(self, other, _BpfLambdaLowerThan, _BpfLambdaLowerThanConst)
 *         elif t == 2:    # ==
 *             return _create_lambda(self, other, _BpfLambdaEqual, _BpfLambdaEqualConst)             # <<<<<<<<<<<<<<
 *         elif t == 4:    # >
 *             return _create_lambda(self, other, _BpfLambdaGreaterThan, _BpfLambdaGreaterThanConst)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_4bpf4_4core__create_lambda(__pyx_v_self, __pyx_v_other, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaEqual), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaEqualConst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":873
 *         if t == 0:      # <
 *             return _create_lambda(self, other, _BpfLambdaLowerThan, _BpfLambdaLowerThanConst)
 *         elif t == 2:    # ==             # <<<<<<<<<<<<<<
 *             return _create_lambda(self, other, _BpfLambdaEqual, _BpfLambdaEqualConst)
 *         elif t == 4:    # >
 */
    break;
    case 4:

    /* "bpf4/core.pyx":876
 *             return _create_lambda(self, other, _BpfLambdaEqual, _BpfLambdaEqualConst)
 *         elif t == 4:    # >
 *             return _create_lambda(self, other, _BpfLambdaGreaterThan, _BpfLambdaGreaterThanConst)             # <<<<<<<<<<<<<<
 *         elif t == 1:    # <=
 *             return _create_lambda(self, other, _BpfLambdaLowerOrEqualThan, _BpfLambdaLowerOrEqualThanConst)       # (self > other) == 0
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_4bpf4_4core__create_lambda(__pyx_v_self, __pyx_v_other, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaGreaterThan), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaGreaterThanConst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":875
 *         elif t == 2:    # ==
 *             return _create_lambda(self, other, _BpfLambdaEqual, _BpfLambdaEqualConst)
 *         elif t == 4:    # >             # <<<<<<<<<<<<<<
 *             return _create_lambda(self, other, _BpfLambdaGreaterThan, _BpfLambdaGreaterThanConst)
 *         elif t == 1:    # <=
 */
    break;
    case 1:

    /* "bpf4/core.pyx":878
 *             return _create_lambda(self, other, _BpfLambdaGreaterThan, _BpfLambdaGreaterThanConst)
 *         elif t == 1:    # <=
 *             return _create_lambda(self, other, _BpfLambdaLowerOrEqualThan, _BpfLambdaLowerOrEqualThanConst)       # (self > other) == 0             # <<<<<<<<<<<<<<
 *         elif t == 3:    # !=
 *             return _create_lambda(self, other, _BpfLambdaUnequal, _BpfLambdaUnequalConst)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_4bpf4_4core__create_lambda(__pyx_v_self, __pyx_v_other, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaLowerOrEqualThan), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaLowerOrEqualThanConst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":877
 *         elif t == 4:    # >
 *             return _create_lambda(self, other, _BpfLambdaGreaterThan, _BpfLambdaGreaterThanConst)
 *         elif t == 1:    # <=             # <<<<<<<<<<<<<<
 *             return _create_lambda(self, other, _BpfLambdaLowerOrEqualThan, _BpfLambdaLowerOrEqualThanConst)       # (self > other) == 0
 *         elif t == 3:    # !=
 */
    break;
    case 3:

    /* "bpf4/core.pyx":880
 *             return _create_lambda(self, other, _BpfLambdaLowerOrEqualThan, _BpfLambdaLowerOrEqualThanConst)       # (self > other) == 0
 *         elif t == 3:    # !=
 *             return _create_lambda(self, other, _BpfLambdaUnequal, _BpfLambdaUnequalConst)             # <<<<<<<<<<<<<<
 *         elif t == 5:    # >=
 *             return _create_lambda(self, other, _BpfLambdaGreaterOrEqualThan, _BpfLambdaGreaterOrEqualThanConst) # (self < other) == 0
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_4bpf4_4core__create_lambda(__pyx_v_self, __pyx_v_other, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaUnequal), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaUnequalConst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":879
 *         elif t == 1:    # <=
 *             return _create_lambda(self, other, _BpfLambdaLowerOrEqualThan, _BpfLambdaLowerOrEqualThanConst)       # (self > other) == 0
 *         elif t == 3:    # !=             # <<<<<<<<<<<<<<
 *             return _create_lambda(self, other, _BpfLambdaUnequal, _BpfLambdaUnequalConst)
 *         elif t == 5:    # >=
 */
    break;
    case 5:

    /* "bpf4/core.pyx":882
 *             return _create_lambda(self, other, _BpfLambdaUnequal, _BpfLambdaUnequalConst)
 *         elif t == 5:    # >=
 *             return _create_lambda(self, other, _BpfLambdaGreaterOrEqualThan, _BpfLambdaGreaterOrEqualThanConst) # (self < other) == 0             # <<<<<<<<<<<<<<
 * 
 *     def _get_points_for_rendering(self, int n= -1):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_4bpf4_4core__create_lambda(__pyx_v_self, __pyx_v_other, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaGreaterOrEqualThan), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":881
 *         elif t == 3:    # !=
 *             return _create_lambda(self, other, _BpfLambdaUnequal, _BpfLambdaUnequalConst)
 *         elif t == 5:    # >=             # <<<<<<<<<<<<<<
 *             return _create_lambda(self, other, _BpfLambdaGreaterOrEqualThan, _BpfLambdaGreaterOrEqualThanConst) # (self < other) == 0
 * 
 */
    break;
    default: break;
  }

  /* "bpf4/core.pyx":870
 *         return NotImplemented
 * 
 *     def __richcmp__(BpfInterface self, other, int t):             # <<<<<<<<<<<<<<
 *         if t == 0:      # <
 *             return _create_lambda(self, other, _BpfLambdaLowerThan, _BpfLambdaLowerThanConst)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":884
 *             return _create_lambda(self, other, _BpfLambdaGreaterOrEqualThan, _BpfLambdaGreaterOrEqualThanConst) # (self < other) == 0
 * 
 *     def _get_points_for_rendering(self, int n= -1):             # <<<<<<<<<<<<<<
 *         # BpfInterface
 *         if n == -1:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_37_get_points_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_36_get_points_for_rendering[] = "BpfInterface._get_points_for_rendering(self, int n=-1)";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_37_get_points_for_rendering = {"_get_points_for_rendering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_37_get_points_for_rendering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_36_get_points_for_rendering};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_37_get_points_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_points_for_rendering (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_points_for_rendering") < 0)) __PYX_ERR(0, 884, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L3_error)
    } else {
      __pyx_v_n = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_points_for_rendering", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 884, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface._get_points_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_36_get_points_for_rendering(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_36_get_points_for_rendering(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_v_n) {
  PyObject *__pyx_v_xs = NULL;
  PyArrayObject *__pyx_v_ys = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_points_for_rendering", 0);

  /* "bpf4/core.pyx":886
 *     def _get_points_for_rendering(self, int n= -1):
 *         # BpfInterface
 *         if n == -1:             # <<<<<<<<<<<<<<
 *             n = NUM_XS_FOR_RENDERING
 *         xs = numpy.linspace(self._x0, self._x1, n)
 */
  __pyx_t_1 = ((__pyx_v_n == -1L) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":887
 *         # BpfInterface
 *         if n == -1:
 *             n = NUM_XS_FOR_RENDERING             # <<<<<<<<<<<<<<
 *         xs = numpy.linspace(self._x0, self._x1, n)
 *         ys = self.mapn_between(n, self._x0, self._x1)
 */
    __pyx_v_n = 0xC8;

    /* "bpf4/core.pyx":886
 *     def _get_points_for_rendering(self, int n= -1):
 *         # BpfInterface
 *         if n == -1:             # <<<<<<<<<<<<<<
 *             n = NUM_XS_FOR_RENDERING
 *         xs = numpy.linspace(self._x0, self._x1, n)
 */
  }

  /* "bpf4/core.pyx":888
 *         if n == -1:
 *             n = NUM_XS_FOR_RENDERING
 *         xs = numpy.linspace(self._x0, self._x1, n)             # <<<<<<<<<<<<<<
 *         ys = self.mapn_between(n, self._x0, self._x1)
 *         return xs, ys
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_linspace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 888, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_6);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_xs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":889
 *             n = NUM_XS_FOR_RENDERING
 *         xs = numpy.linspace(self._x0, self._x1, n)
 *         ys = self.mapn_between(n, self._x0, self._x1)             # <<<<<<<<<<<<<<
 *         return xs, ys
 * 
 */
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->mapn_between(__pyx_v_self, __pyx_v_n, __pyx_v_self->_x0, __pyx_v_self->_x1, 0, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ys = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":890
 *         xs = numpy.linspace(self._x0, self._x1, n)
 *         ys = self.mapn_between(n, self._x0, self._x1)
 *         return xs, ys             # <<<<<<<<<<<<<<
 * 
 *     def render(self, xs, interpolation='linear'):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_xs);
  __Pyx_GIVEREF(__pyx_v_xs);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_xs);
  __Pyx_INCREF(((PyObject *)__pyx_v_ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_ys));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_ys));
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":884
 *             return _create_lambda(self, other, _BpfLambdaGreaterOrEqualThan, _BpfLambdaGreaterOrEqualThanConst) # (self < other) == 0
 * 
 *     def _get_points_for_rendering(self, int n= -1):             # <<<<<<<<<<<<<<
 *         # BpfInterface
 *         if n == -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bpf4.core.BpfInterface._get_points_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xs);
  __Pyx_XDECREF((PyObject *)__pyx_v_ys);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":892
 *         return xs, ys
 * 
 *     def render(self, xs, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new bpf representing this bpf rendered at the given points
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_39render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_38render[] = "BpfInterface.render(self, xs, interpolation=u'linear')\n\n        Create a new bpf representing this bpf rendered at the given points\n\n        The difference between `.render` and `.sampled` is that this method\n        creates a Linear/NoInterpol bpf whereas `.sampled` returns a \n        `Sampled` bpf (a `Sampled` bpf works only for regularly sampled data,\n        a Linear or NoInterpol bpfs accept any data as its x coordinate)\n\n        Args:\n            xs (int | list | np.ndarray): a seq of points at which this bpf \n                is sampled or a number, in which case an even grid is calculated \n                with that number of points. In the first case a Linear or NoInterpol\n                bpf is returned depending on the `interpolation` parameter (see below).\n                In the second case a `Sampled` bpf is returned.\n            interpolation (str): the interpoltation type of the returned bpf. \n                One of 'linear', 'nointerpol'\n\n        Returns:\n            (BpfInterface) a new bpf representing this bpf. Depending on the interpolation\n            this new bpf will be a Sampled, a Linear or a NoInterpol bpf\n\n        Example\n        -------\n\n        ```python\n\n        >>> from bpf4 import *\n        >>> from math import *\n        >>> a = slope(1)[0:4*pi].sin()\n        >>> b = a.render(20)   # Sample this bpf at 20 points within its bounds\n        >>> b\n        Sampled[0.0:12.566370614359172]\n        >>> b.plot()\n        ```\n        ![](assets/render1.png)\n\n        !!! info \"See Also\"\n\n            [BpfInterface.sampled](#sampled)\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_39render = {"render", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_39render, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_38render};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_39render(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_interpolation = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("render (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_interpolation,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_u_linear);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolation);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) __PYX_ERR(0, 892, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_interpolation = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("render", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 892, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_38render(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_xs, __pyx_v_interpolation);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_38render(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_interpolation) {
  PyObject *__pyx_v_dx = NULL;
  PyArrayObject *__pyx_v_ys = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  double __pyx_t_7;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("render", 0);

  /* "bpf4/core.pyx":934
 * 
 *         """
 *         if isinstance(xs, (int, long)):             # <<<<<<<<<<<<<<
 *             dx = (self._x1 - self._x0) / (xs - 1)
 *             return self.sampled(dx, interpolation=interpolation)
 */
  __pyx_t_2 = PyInt_Check(__pyx_v_xs); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyLong_Check(__pyx_v_xs); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":935
 *         """
 *         if isinstance(xs, (int, long)):
 *             dx = (self._x1 - self._x0) / (xs - 1)             # <<<<<<<<<<<<<<
 *             return self.sampled(dx, interpolation=interpolation)
 *         else:
 */
    __pyx_t_4 = PyFloat_FromDouble((__pyx_v_self->_x1 - __pyx_v_self->_x0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_xs, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_dx = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "bpf4/core.pyx":936
 *         if isinstance(xs, (int, long)):
 *             dx = (self._x1 - self._x0) / (xs - 1)
 *             return self.sampled(dx, interpolation=interpolation)             # <<<<<<<<<<<<<<
 *         else:
 *             ys = self.map(xs)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_dx); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 936, __pyx_L1_error)
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.interpolation = __pyx_v_interpolation;
    __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->sampled(__pyx_v_self, __pyx_t_7, 0, &__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":934
 * 
 *         """
 *         if isinstance(xs, (int, long)):             # <<<<<<<<<<<<<<
 *             dx = (self._x1 - self._x0) / (xs - 1)
 *             return self.sampled(dx, interpolation=interpolation)
 */
  }

  /* "bpf4/core.pyx":938
 *             return self.sampled(dx, interpolation=interpolation)
 *         else:
 *             ys = self.map(xs)             # <<<<<<<<<<<<<<
 *             if interpolation == 'linear':
 *                 return Linear(xs, ys)
 */
  /*else*/ {
    __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->map(__pyx_v_self, __pyx_v_xs, 0, NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_ys = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "bpf4/core.pyx":939
 *         else:
 *             ys = self.map(xs)
 *             if interpolation == 'linear':             # <<<<<<<<<<<<<<
 *                 return Linear(xs, ys)
 *             elif interpolation == 'nointerpol':
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_interpolation, __pyx_n_u_linear, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 939, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":940
 *             ys = self.map(xs)
 *             if interpolation == 'linear':
 *                 return Linear(xs, ys)             # <<<<<<<<<<<<<<
 *             elif interpolation == 'nointerpol':
 *                 return NoInterpol(xs, ys)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 940, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_xs);
      __Pyx_GIVEREF(__pyx_v_xs);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_xs);
      __Pyx_INCREF(((PyObject *)__pyx_v_ys));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_ys));
      PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_ys));
      __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Linear), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 940, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":939
 *         else:
 *             ys = self.map(xs)
 *             if interpolation == 'linear':             # <<<<<<<<<<<<<<
 *                 return Linear(xs, ys)
 *             elif interpolation == 'nointerpol':
 */
    }

    /* "bpf4/core.pyx":941
 *             if interpolation == 'linear':
 *                 return Linear(xs, ys)
 *             elif interpolation == 'nointerpol':             # <<<<<<<<<<<<<<
 *                 return NoInterpol(xs, ys)
 *             else:
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_interpolation, __pyx_n_u_nointerpol, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 941, __pyx_L1_error)
    if (likely(__pyx_t_2)) {

      /* "bpf4/core.pyx":942
 *                 return Linear(xs, ys)
 *             elif interpolation == 'nointerpol':
 *                 return NoInterpol(xs, ys)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError("interpolation %s not implemented" % interpolation)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 942, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_xs);
      __Pyx_GIVEREF(__pyx_v_xs);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_xs);
      __Pyx_INCREF(((PyObject *)__pyx_v_ys));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_ys));
      PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_ys));
      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_NoInterpol), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 942, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":941
 *             if interpolation == 'linear':
 *                 return Linear(xs, ys)
 *             elif interpolation == 'nointerpol':             # <<<<<<<<<<<<<<
 *                 return NoInterpol(xs, ys)
 *             else:
 */
    }

    /* "bpf4/core.pyx":944
 *                 return NoInterpol(xs, ys)
 *             else:
 *                 raise ValueError("interpolation %s not implemented" % interpolation)             # <<<<<<<<<<<<<<
 * 
 *     def plot(self, kind='line', int n=-1, show=True, axes=None, **keys):
 */
    /*else*/ {
      __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_interpolation_s_not_implemented, __pyx_v_interpolation); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 944, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 944, __pyx_L1_error)
    }
  }

  /* "bpf4/core.pyx":892
 *         return xs, ys
 * 
 *     def render(self, xs, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new bpf representing this bpf rendered at the given points
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dx);
  __Pyx_XDECREF((PyObject *)__pyx_v_ys);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":946
 *                 raise ValueError("interpolation %s not implemented" % interpolation)
 * 
 *     def plot(self, kind='line', int n=-1, show=True, axes=None, **keys):             # <<<<<<<<<<<<<<
 *         """
 *         Plot the bpf. Any key is passed to plot.plot_coords
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_41plot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_40plot[] = "BpfInterface.plot(self, kind=u'line', int n=-1, show=True, axes=None, **keys)\n\n        Plot the bpf. Any key is passed to plot.plot_coords\n\n        Args:\n            kind (str): one of 'line', 'bar'\n            n (int): the number of points to plot\n            show (bool): if the plot should be shown immediately after (default is True). \n                If you want to display multiple BPFs sharing an axes you can call \n                plot on each of the bpfs with show=False, and then either\n                call the last one with plot=True or call bpf4.plot.show().\n            axes (matplotlib.pyplot.Axes): if given, will be used to plot onto it,\n                otherwise an ad-hoc axes is created\n            kws: any keyword will be passed to plot.plot_coords\n                \n        ## Example\n\n        ```python\n\n        from bpf4 import *\n        a = linear(0, 0, 1, 10, 2, 0.5)\n        a.plot()\n\n        # Plot to a preexistent axes\n        ax = plt.subplot()\n        a.plot(axes=ax)\n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_41plot = {"plot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_41plot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_40plot};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_41plot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_kind = 0;
  int __pyx_v_n;
  PyObject *__pyx_v_show = 0;
  PyObject *__pyx_v_axes = 0;
  PyObject *__pyx_v_keys = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("plot (wrapper)", 0);
  __pyx_v_keys = PyDict_New(); if (unlikely(!__pyx_v_keys)) return NULL;
  __Pyx_GOTREF(__pyx_v_keys);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_kind,&__pyx_n_s_n,&__pyx_n_s_show,&__pyx_n_s_axes,0};
    PyObject* values[4] = {0,0,0,0};
    values[0] = ((PyObject *)__pyx_n_u_line);
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kind);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_show);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_axes);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_keys, values, pos_args, "plot") < 0)) __PYX_ERR(0, 946, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_kind = values[0];
    if (values[1]) {
      __pyx_v_n = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 946, __pyx_L3_error)
    } else {
      __pyx_v_n = ((int)-1);
    }
    __pyx_v_show = values[2];
    __pyx_v_axes = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("plot", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 946, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_keys); __pyx_v_keys = 0;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.plot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_40plot(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_kind, __pyx_v_n, __pyx_v_show, __pyx_v_axes, __pyx_v_keys);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_keys);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_40plot(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_kind, int __pyx_v_n, PyObject *__pyx_v_show, PyObject *__pyx_v_axes, PyObject *__pyx_v_keys) {
  PyObject *__pyx_v_xs = NULL;
  PyObject *__pyx_v_ys = NULL;
  PyObject *__pyx_v_plot = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("plot", 0);

  /* "bpf4/core.pyx":974
 *         ```
 *         """
 *         xs, ys = self._get_points_for_rendering(n)             # <<<<<<<<<<<<<<
 *         from . import plot
 *         plot.plot_coords(xs, ys, kind=kind, show=show, axes=axes, **keys)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_points_for_rendering); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 974, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 974, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 974, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_xs = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_ys = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bpf4/core.pyx":975
 *         """
 *         xs, ys = self._get_points_for_rendering(n)
 *         from . import plot             # <<<<<<<<<<<<<<
 *         plot.plot_coords(xs, ys, kind=kind, show=show, axes=axes, **keys)
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_plot);
  __Pyx_GIVEREF(__pyx_n_s_plot);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_plot);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s__6, __pyx_t_1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_plot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_plot = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "bpf4/core.pyx":976
 *         xs, ys = self._get_points_for_rendering(n)
 *         from . import plot
 *         plot.plot_coords(xs, ys, kind=kind, show=show, axes=axes, **keys)             # <<<<<<<<<<<<<<
 * 
 *     cpdef BpfInterface sampled(self, double dx, interpolation='linear'):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_plot, __pyx_n_s_plot_coords); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_xs);
  __Pyx_GIVEREF(__pyx_v_xs);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xs);
  __Pyx_INCREF(__pyx_v_ys);
  __Pyx_GIVEREF(__pyx_v_ys);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ys);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_kind, __pyx_v_kind) < 0) __PYX_ERR(0, 976, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_show, __pyx_v_show) < 0) __PYX_ERR(0, 976, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axes, __pyx_v_axes) < 0) __PYX_ERR(0, 976, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_4 = 0;
  if (__Pyx_MergeKeywords(__pyx_t_2, __pyx_v_keys) < 0) __PYX_ERR(0, 976, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "bpf4/core.pyx":946
 *                 raise ValueError("interpolation %s not implemented" % interpolation)
 * 
 *     def plot(self, kind='line', int n=-1, show=True, axes=None, **keys):             # <<<<<<<<<<<<<<
 *         """
 *         Plot the bpf. Any key is passed to plot.plot_coords
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.plot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xs);
  __Pyx_XDECREF(__pyx_v_ys);
  __Pyx_XDECREF(__pyx_v_plot);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":978
 *         plot.plot_coords(xs, ys, kind=kind, show=show, axes=axes, **keys)
 * 
 *     cpdef BpfInterface sampled(self, double dx, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Sample this bpf at a regular interval, returns a Sampled bpf
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_43sampled(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_sampled(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_dx, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled *__pyx_optional_args) {
  PyObject *__pyx_v_interpolation = ((PyObject *)__pyx_n_u_linear);
  int __pyx_v_n;
  PyArrayObject *__pyx_v_ys = NULL;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  double __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sampled", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_interpolation = __pyx_optional_args->interpolation;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sampled); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_43sampled)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_interpolation};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_interpolation};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 978, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
          __Pyx_INCREF(__pyx_v_interpolation);
          __Pyx_GIVEREF(__pyx_v_interpolation);
          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_interpolation);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 978, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1011
 *         """
 *         # we need to account for the edge (x1 IS INCLUDED)
 *         cdef int n = int((self._x1 - self._x0) / dx + 0.5) + 1             # <<<<<<<<<<<<<<
 *         ys = self.mapn_between(n, self._x0, self._x1)
 *         return Sampled(ys, dx=dx, x0=self._x0, interpolation=interpolation)
 */
  __pyx_t_8 = (__pyx_v_self->_x1 - __pyx_v_self->_x0);
  if (unlikely(__pyx_v_dx == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1011, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyInt_FromDouble(((__pyx_t_8 / __pyx_v_dx) + 0.5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_6;

  /* "bpf4/core.pyx":1012
 *         # we need to account for the edge (x1 IS INCLUDED)
 *         cdef int n = int((self._x1 - self._x0) / dx + 0.5) + 1
 *         ys = self.mapn_between(n, self._x0, self._x1)             # <<<<<<<<<<<<<<
 *         return Sampled(ys, dx=dx, x0=self._x0, interpolation=interpolation)
 * 
 */
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->mapn_between(__pyx_v_self, __pyx_v_n, __pyx_v_self->_x0, __pyx_v_self->_x1, 0, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ys = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":1013
 *         cdef int n = int((self._x1 - self._x0) / dx + 0.5) + 1
 *         ys = self.mapn_between(n, self._x0, self._x1)
 *         return Sampled(ys, dx=dx, x0=self._x0, interpolation=interpolation)             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray sample_between(self, double x0, double x1, double dx, ndarray out=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_ys));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ys));
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dx, __pyx_t_4) < 0) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_x0, __pyx_t_4) < 0) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolation, __pyx_v_interpolation) < 0) __PYX_ERR(0, 1013, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Sampled), __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":978
 *         plot.plot_coords(xs, ys, kind=kind, show=show, axes=axes, **keys)
 * 
 *     cpdef BpfInterface sampled(self, double dx, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Sample this bpf at a regular interval, returns a Sampled bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sampled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ys);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_43sampled(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_42sampled[] = "BpfInterface.sampled(self, double dx, interpolation=u'linear') -> BpfInterface\n\n        Sample this bpf at a regular interval, returns a Sampled bpf\n\n        Sample this bpf at an interval of dx (samplerate = 1 / dx)\n        returns a Sampled bpf with the given interpolation between the samples\n\n        Args:\n            dx (float): the sample interval\n            interpolation (str): the interpolation kind. One of 'linear',\n                'nointerpol', 'halfcos', 'expon(XX)', 'halfcos(XX)' (where\n                XX is an exponential passed to the interpolation function)\n\n        Returns:\n            (Sampled) The sampled bpf\n        \n        !!! note\n\n            If you need to sample a portion of the bpf, use [sampled_between](#sampled_between)\n\n        The same results can be achieved via indexing, in which case the resulting\n        bpf will be linearly interpolated:\n\n        ```python\n        bpf[::0.1]    # returns a sampled version of this bpf with a dx of 0.1\n        bpf[:10:0.1]  # samples this bpf between (x0, 10) at a dx of 0.1\n        ```\n\n        !!! info \"See Also\"\n\n            [ntodx](#ntodx), [dxton](#dxton)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_43sampled = {"sampled", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_43sampled, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_42sampled};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_43sampled(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_dx;
  PyObject *__pyx_v_interpolation = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sampled (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dx,&__pyx_n_s_interpolation,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_u_linear);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolation);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sampled") < 0)) __PYX_ERR(0, 978, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dx = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 978, __pyx_L3_error)
    __pyx_v_interpolation = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sampled", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 978, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sampled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_42sampled(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_dx, __pyx_v_interpolation);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_42sampled(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_dx, PyObject *__pyx_v_interpolation) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sampled", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.interpolation = __pyx_v_interpolation;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_BpfInterface->sampled(__pyx_v_self, __pyx_v_dx, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sampled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1015
 *         return Sampled(ys, dx=dx, x0=self._x0, interpolation=interpolation)
 * 
 *     cpdef ndarray sample_between(self, double x0, double x1, double dx, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sample this bpf at an interval of dx between x0 and x1
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_45sample_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_12BpfInterface_sample_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, double __pyx_v_dx, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sample_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  int __pyx_v_n;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sample_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sample_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_45sample_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1015, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1015, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1015, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1015, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1046
 *         """
 *         cdef int n
 *         n = int((x1 - x0) / dx + 0.5) + 1             # <<<<<<<<<<<<<<
 *         return self.mapn_between(n, x0, x1, out)
 * 
 */
  __pyx_t_10 = (__pyx_v_x1 - __pyx_v_x0);
  if (unlikely(__pyx_v_dx == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1046, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyInt_FromDouble(((__pyx_t_10 / __pyx_v_dx) + 0.5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_8;

  /* "bpf4/core.pyx":1047
 *         cdef int n
 *         n = int((x1 - x0) / dx + 0.5) + 1
 *         return self.mapn_between(n, x0, x1, out)             # <<<<<<<<<<<<<<
 * 
 *     cpdef BpfInterface sampled_between(self, double x0, double x1, double dx, interpolation='linear'):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.out = __pyx_v_out;
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->mapn_between(__pyx_v_self, __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1015
 *         return Sampled(ys, dx=dx, x0=self._x0, interpolation=interpolation)
 * 
 *     cpdef ndarray sample_between(self, double x0, double x1, double dx, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sample this bpf at an interval of dx between x0 and x1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sample_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_45sample_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_44sample_between[] = "BpfInterface.sample_between(self, double x0, double x1, double dx, ndarray out=None) -> ndarray\n\n        Sample this bpf at an interval of dx between x0 and x1 \n\n        !!! note\n\n            The interface is similar to numpy's `linspace`\n        \n        Args:\n            x0 (float): point to start sampling (included)\n            x1 (float): point to stop sampling (included)\n            dx (float): the sampling period\n            out (ndarray): if given, the result will be placed here and no new array will\n                be allocated\n\n        Returns:\n            (ndarray) An array with the values of this bpf sampled at at a regular grid of \n            period `dx` from `x0` to `x1`. If out is given the result is placed in it\n\n        ## Example\n        \n        ```python\n        \n        >>> a = linear(0, 0, 10, 10)\n        >>> a.sample_between(0, 10, 1)\n        [0 1 2 3 4 5 6 7 8 9 10]\n        ```\n        \n        This is the same as `a.mapn_between(11, 0, 10)`\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_45sample_between = {"sample_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_45sample_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_44sample_between};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_45sample_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  double __pyx_v_dx;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sample_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_dx,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sample_between", 0, 3, 4, 1); __PYX_ERR(0, 1015, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sample_between", 0, 3, 4, 2); __PYX_ERR(0, 1015, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sample_between") < 0)) __PYX_ERR(0, 1015, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1015, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1015, __pyx_L3_error)
    __pyx_v_dx = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1015, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sample_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1015, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sample_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 1015, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_44sample_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_dx, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_44sample_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, double __pyx_v_dx, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sample_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sample_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_BpfInterface->sample_between(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, __pyx_v_dx, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sample_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1049
 *         return self.mapn_between(n, x0, x1, out)
 * 
 *     cpdef BpfInterface sampled_between(self, double x0, double x1, double dx, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Sample a portion of this bpf, returns a `Sampled` bpf
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_47sampled_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_sampled_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, double __pyx_v_dx, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled_between *__pyx_optional_args) {
  PyObject *__pyx_v_interpolation = ((PyObject *)__pyx_n_u_linear);
  int __pyx_v_n;
  PyArrayObject *__pyx_v_ys = NULL;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sampled_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_interpolation = __pyx_optional_args->interpolation;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sampled_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_47sampled_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1049, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_interpolation};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_interpolation};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1049, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(__pyx_v_interpolation);
          __Pyx_GIVEREF(__pyx_v_interpolation);
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_v_interpolation);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 1049, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1068
 *             with the given interpolation
 *         """
 *         cdef int n = int((x1 - x0) / dx + 0.5) + 1             # <<<<<<<<<<<<<<
 *         ys = self.mapn_between(n, x0, x1)
 *         return Sampled(ys, dx=dx, x0=x0, interpolation=interpolation)
 */
  __pyx_t_10 = (__pyx_v_x1 - __pyx_v_x0);
  if (unlikely(__pyx_v_dx == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1068, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyInt_FromDouble(((__pyx_t_10 / __pyx_v_dx) + 0.5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_8;

  /* "bpf4/core.pyx":1069
 *         """
 *         cdef int n = int((x1 - x0) / dx + 0.5) + 1
 *         ys = self.mapn_between(n, x0, x1)             # <<<<<<<<<<<<<<
 *         return Sampled(ys, dx=dx, x0=x0, interpolation=interpolation)
 * 
 */
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->mapn_between(__pyx_v_self, __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 0, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ys = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":1070
 *         cdef int n = int((x1 - x0) / dx + 0.5) + 1
 *         ys = self.mapn_between(n, x0, x1)
 *         return Sampled(ys, dx=dx, x0=x0, interpolation=interpolation)             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_ys));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ys));
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dx, __pyx_t_6) < 0) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_x0, __pyx_t_6) < 0) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolation, __pyx_v_interpolation) < 0) __PYX_ERR(0, 1070, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Sampled), __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1049
 *         return self.mapn_between(n, x0, x1, out)
 * 
 *     cpdef BpfInterface sampled_between(self, double x0, double x1, double dx, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Sample a portion of this bpf, returns a `Sampled` bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sampled_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ys);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_47sampled_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_46sampled_between[] = "BpfInterface.sampled_between(self, double x0, double x1, double dx, interpolation=u'linear') -> BpfInterface\n\n        Sample a portion of this bpf, returns a `Sampled` bpf\n\n        **NB**: This is the same as `thisbpf[x0:x1:dx]`\n        \n        Args:\n            x0 (float): point to start sampling (included)\n            x1 (float): point to stop sampling (included)\n            dx (float): the sampling period\n            interpolation (str): the interpolation kind. One of 'linear',\n                'nointerpol', 'halfcos', 'expon(XX)', 'halfcos(XX)' (where\n                XX is an exponential passed to the interpolation function). For \n                example: 'expon(2.0)' or 'halfcos(0.5)'\n        \n        Returns:\n            (Sampled) The `Sampled` bpf, representing this bpf sampled at a grid of `[x0:x1:dx]`\n            with the given interpolation\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_47sampled_between = {"sampled_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_47sampled_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_46sampled_between};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_47sampled_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  double __pyx_v_dx;
  PyObject *__pyx_v_interpolation = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sampled_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_dx,&__pyx_n_s_interpolation,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)__pyx_n_u_linear);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sampled_between", 0, 3, 4, 1); __PYX_ERR(0, 1049, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sampled_between", 0, 3, 4, 2); __PYX_ERR(0, 1049, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolation);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sampled_between") < 0)) __PYX_ERR(0, 1049, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error)
    __pyx_v_dx = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error)
    __pyx_v_interpolation = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sampled_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1049, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sampled_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_46sampled_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_dx, __pyx_v_interpolation);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_46sampled_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, double __pyx_v_dx, PyObject *__pyx_v_interpolation) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sampled_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.interpolation = __pyx_v_interpolation;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_BpfInterface->sampled_between(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, __pyx_v_dx, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sampled_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1072
 *         return Sampled(ys, dx=dx, x0=x0, interpolation=interpolation)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate an array of `n` values representing this bpf between `x0` and `x1`
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_49mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_12BpfInterface_mapn_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  __Pyx_memviewslice __pyx_v_result = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_dx;
  size_t __pyx_v_i;
  double __pyx_v_x;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_11;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_13;
  size_t __pyx_t_14;
  size_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_49mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1072, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1072, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1072, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1072, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1097
 *         ```
 *         """
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)             # <<<<<<<<<<<<<<
 *         cdef double dx = _ntodx(n, x0, x1)
 *         cdef size_t i
 */
  __pyx_t_11 = (((PyObject *)__pyx_v_out) != Py_None);
  if ((__pyx_t_11 != 0)) {
    __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(((PyObject *)__pyx_v_out), PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 1097, __pyx_L1_error)
    __pyx_t_10 = __pyx_t_12;
    __pyx_t_12.memview = NULL;
    __pyx_t_12.data = NULL;
  } else {
    __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1097, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 1097, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_t_12;
    __pyx_t_12.memview = NULL;
    __pyx_t_12.data = NULL;
  }
  __pyx_v_result = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "bpf4/core.pyx":1098
 *         """
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)
 *         cdef double dx = _ntodx(n, x0, x1)             # <<<<<<<<<<<<<<
 *         cdef size_t i
 *         cdef double x
 */
  __pyx_v_dx = __pyx_f_4bpf4_4core__ntodx(__pyx_v_n, __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":1101
 *         cdef size_t i
 *         cdef double x
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             x = x0 + i*dx
 *             result[i] = self.__ccall__(x)
 */
  __pyx_t_8 = __pyx_v_n;
  __pyx_t_13 = __pyx_t_8;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
    __pyx_v_i = __pyx_t_14;

    /* "bpf4/core.pyx":1102
 *         cdef double x
 *         for i in range(n):
 *             x = x0 + i*dx             # <<<<<<<<<<<<<<
 *             result[i] = self.__ccall__(x)
 *         return numpy.asarray(result)
 */
    __pyx_v_x = (__pyx_v_x0 + (__pyx_v_i * __pyx_v_dx));

    /* "bpf4/core.pyx":1103
 *         for i in range(n):
 *             x = x0 + i*dx
 *             result[i] = self.__ccall__(x)             # <<<<<<<<<<<<<<
 *         return numpy.asarray(result)
 * 
 */
    __pyx_t_15 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_result.data) + __pyx_t_15)) )) = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->__pyx___ccall__(__pyx_v_self, __pyx_v_x);
  }

  /* "bpf4/core.pyx":1104
 *             x = x0 + i*dx
 *             result[i] = self.__ccall__(x)
 *         return numpy.asarray(result)             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_result, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1104, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1072
 *         return Sampled(ys, dx=dx, x0=x0, interpolation=interpolation)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate an array of `n` values representing this bpf between `x0` and `x1`
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_49mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_48mapn_between[] = "BpfInterface.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray\n\n        Calculate an array of `n` values representing this bpf between `x0` and `x1`\n\n        Args:\n            x0 (float): lower bound to map this bpf\n            x1 (float): upper bound to map this bpf\n            out (ndarray): if included, results are placed here. \n\n        Returns:\n            (ndarray) An array of `n` elements representing this bpf at the given \n            values within the range `x0:x1`. This is `out` if it was passed \n\n        x0 and x1 are included\n\n        Example\n        =======\n\n        ```python\n        \n        out = numpy.empty((100,), dtype=float)\n        out = thisbpf.mapn_between(100, 0, 10, out)\n        \n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_49mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_49mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_48mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_49mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 1072, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 1072, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 1072, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1072, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1072, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1072, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1072, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 1072, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_48mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_48mapn_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_BpfInterface->mapn_between(__pyx_v_self, __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1106
 *         return numpy.asarray(result)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         The same as map(self, xs) but faster
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_51map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_12BpfInterface_map(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  __Pyx_memviewslice __pyx_v__xs = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_nx;
  __Pyx_memviewslice __pyx_v_result = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_9;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
  size_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_51map)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1106, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(__pyx_v_xs);
          __Pyx_GIVEREF(__pyx_v_xs);
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_xs);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_out));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1106, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1134
 *         ```
 *         """
 *         if isinstance(xs, int):             # <<<<<<<<<<<<<<
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 * 
 */
  __pyx_t_7 = PyInt_Check(__pyx_v_xs); 
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "bpf4/core.pyx":1135
 *         """
 *         if isinstance(xs, int):
 *             return self.mapn_between(xs, self._x0, self._x1, out)             # <<<<<<<<<<<<<<
 * 
 *         cdef double[::1] _xs = <ndarray>xs if isinstance(xs, ndarray) else numpy.asarray(xs)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_xs); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1135, __pyx_L1_error)
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.out = __pyx_v_out;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->mapn_between(__pyx_v_self, __pyx_t_5, __pyx_v_self->_x0, __pyx_v_self->_x1, 0, &__pyx_t_9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":1134
 *         ```
 *         """
 *         if isinstance(xs, int):             # <<<<<<<<<<<<<<
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 * 
 */
  }

  /* "bpf4/core.pyx":1137
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 * 
 *         cdef double[::1] _xs = <ndarray>xs if isinstance(xs, ndarray) else numpy.asarray(xs)             # <<<<<<<<<<<<<<
 *         cdef int nx  = len(_xs)
 *         cdef double[::1] result = out if out is not None else EMPTY1D(nx)
 */
  __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_xs, __pyx_ptype_5numpy_ndarray); 
  if ((__pyx_t_8 != 0)) {
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_xs, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1137, __pyx_L1_error)
    __pyx_t_10 = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_xs) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_xs);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1137, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;
  }
  __pyx_v__xs = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "bpf4/core.pyx":1138
 * 
 *         cdef double[::1] _xs = <ndarray>xs if isinstance(xs, ndarray) else numpy.asarray(xs)
 *         cdef int nx  = len(_xs)             # <<<<<<<<<<<<<<
 *         cdef double[::1] result = out if out is not None else EMPTY1D(nx)
 *         cdef int i
 */
  __pyx_t_12 = __Pyx_MemoryView_Len(__pyx_v__xs); 
  __pyx_v_nx = __pyx_t_12;

  /* "bpf4/core.pyx":1139
 *         cdef double[::1] _xs = <ndarray>xs if isinstance(xs, ndarray) else numpy.asarray(xs)
 *         cdef int nx  = len(_xs)
 *         cdef double[::1] result = out if out is not None else EMPTY1D(nx)             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef double x0,x1, dx
 */
  __pyx_t_8 = (((PyObject *)__pyx_v_out) != Py_None);
  if ((__pyx_t_8 != 0)) {
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(((PyObject *)__pyx_v_out), PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1139, __pyx_L1_error)
    __pyx_t_10 = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;
  } else {
    __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_nx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 1139, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_t_11;
    __pyx_t_11.memview = NULL;
    __pyx_t_11.data = NULL;
  }
  __pyx_v_result = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "bpf4/core.pyx":1142
 *         cdef int i
 *         cdef double x0,x1, dx
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for i in range(nx):
 *                 result[i] = self.__ccall__(_xs[i])
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "bpf4/core.pyx":1143
 *         cdef double x0,x1, dx
 *         with nogil:
 *             for i in range(nx):             # <<<<<<<<<<<<<<
 *                 result[i] = self.__ccall__(_xs[i])
 *         return numpy.asarray(result)
 */
        __pyx_t_5 = __pyx_v_nx;
        __pyx_t_13 = __pyx_t_5;
        for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
          __pyx_v_i = __pyx_t_14;

          /* "bpf4/core.pyx":1144
 *         with nogil:
 *             for i in range(nx):
 *                 result[i] = self.__ccall__(_xs[i])             # <<<<<<<<<<<<<<
 *         return numpy.asarray(result)
 * 
 */
          __pyx_t_15 = __pyx_v_i;
          __pyx_t_16 = __pyx_v_i;
          *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_result.data) + __pyx_t_16)) )) = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->__pyx___ccall__(__pyx_v_self, (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v__xs.data) + __pyx_t_15)) ))));
        }
      }

      /* "bpf4/core.pyx":1142
 *         cdef int i
 *         cdef double x0,x1, dx
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for i in range(nx):
 *                 result[i] = self.__ccall__(_xs[i])
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "bpf4/core.pyx":1145
 *             for i in range(nx):
 *                 result[i] = self.__ccall__(_xs[i])
 *         return numpy.asarray(result)             # <<<<<<<<<<<<<<
 * 
 *     cpdef BpfInterface concat(self, BpfInterface other):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_result, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1145, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1106
 *         return numpy.asarray(result)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         The same as map(self, xs) but faster
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v__xs, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_51map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_50map[] = "BpfInterface.map(self, xs, ndarray out=None) -> ndarray\n\n        The same as map(self, xs) but faster\n\n        Args:\n            xs (ndarray | int): the x coordinates at which to sample this bpf,\n                or an integer representing the number of elements to calculate\n                in an evenly spaced grid between the bounds of this bpf\n            out (ndarray): if given, an attempt will be done to use it as destination\n                for the result. The user should not trust that this actually happens\n                (see example)\n\n        ```python\n\n        bpf.map(10) == bpf.map(numpy.linspace(x0, x1, 10))\n        ```\n\n        ## Example\n        \n        ```python\n\n        >>> out = numpy.empty((100,), dtype=float)\n        >>> xs = numpy.linspace(0, 10, 100)\n        # This is the right way to pass an output array\n        >>> out = thisbpf.map(xs, out)   \n        \n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_51map = {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_51map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_50map};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_51map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_out,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 1106, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_out = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1106, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 1106, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_50map(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_xs, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_50map(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_BpfInterface->map(__pyx_v_self, __pyx_v_xs, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1147
 *         return numpy.asarray(result)
 * 
 *     cpdef BpfInterface concat(self, BpfInterface other):             # <<<<<<<<<<<<<<
 *         """
 *         Concatenate this bpf to other
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_53concat(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_concat(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other2 = 0;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("concat", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_concat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_53concat)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_other)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1147, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 1147, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1169
 * 
 *         """
 *         cdef BpfInterface other2 = other.fit_between(self._x1, self._x1 + (other._x1 - other._x0))             # <<<<<<<<<<<<<<
 *         return _BpfConcat2_new(self, other2, other2._x0)
 * 
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_other->__pyx_vtab)->fit_between(__pyx_v_other, __pyx_v_self->_x1, (__pyx_v_self->_x1 + (__pyx_v_other->_x1 - __pyx_v_other->_x0)), 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_other2 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":1170
 *         """
 *         cdef BpfInterface other2 = other.fit_between(self._x1, self._x1 + (other._x1 - other._x0))
 *         return _BpfConcat2_new(self, other2, other2._x0)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfLambdaRound round(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfConcat2_new(__pyx_v_self, __pyx_v_other2, __pyx_v_other2->_x0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1147
 *         return numpy.asarray(result)
 * 
 *     cpdef BpfInterface concat(self, BpfInterface other):             # <<<<<<<<<<<<<<
 *         """
 *         Concatenate this bpf to other
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.concat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_other2);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_53concat(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_52concat[] = "BpfInterface.concat(self, BpfInterface other) -> BpfInterface\n\n        Concatenate this bpf to other\n\n        `other` is shifted to start at the end of `self`\n\n        ## Example\n        \n        ```python\n\n        >>> a = linear(0, 0, 1, 10)\n        >>> b = linear(3, 100, 10, 200)\n        >>> c = a.concat(b)\n        >>> c\n        _BpfConcat2[0.0:8.0]\n        >>> c(1 - 1e-12), c(1)\n        (9.99999999999, 100.0)\n        >>> c.plot()\n        ```\n        ![](assets/concat1.png)\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_53concat = {"concat", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_53concat, METH_O, __pyx_doc_4bpf4_4core_12BpfInterface_52concat};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_53concat(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("concat (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "other", 0))) __PYX_ERR(0, 1147, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_52concat(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_52concat(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("concat", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_concat(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.concat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1172
 *         return _BpfConcat2_new(self, other2, other2._x0)
 * 
 *     cpdef _BpfLambdaRound round(self):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf representing round(self(x))
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_55round(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfLambdaRound *__pyx_f_4bpf4_4core_12BpfInterface_round(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaRound *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("round", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_round); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_55round)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfLambdaRound))))) __PYX_ERR(0, 1172, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfLambdaRound *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1179
 *             (BpfInterface) A bpf representing the operation `round(self(x))`
 *         """
 *         return _BpfLambdaRound(self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfRand rand(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRound), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfLambdaRound *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1172
 *         return _BpfConcat2_new(self, other2, other2._x0)
 * 
 *     cpdef _BpfLambdaRound round(self):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf representing round(self(x))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.round", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_55round(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_54round[] = "BpfInterface.round(self) -> _BpfLambdaRound\n\n        A bpf representing round(self(x))\n\n        Returns:\n            (BpfInterface) A bpf representing the operation `round(self(x))`\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_55round = {"round", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_55round, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_54round};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_55round(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("round (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_54round(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_54round(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("round", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_round(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.round", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1181
 *         return _BpfLambdaRound(self)
 * 
 *     cpdef _BpfRand rand(self):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf representing rand(self(x))
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_57rand(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfRand *__pyx_f_4bpf4_4core_12BpfInterface_rand(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfRand *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rand", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rand); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_57rand)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfRand))))) __PYX_ERR(0, 1181, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfRand *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1188
 *             (BpfInterface) A bpf representing the operation ``rand(self(x))`
 *         """
 *         return _BpfRand(self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc cos(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfRand), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfRand *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1181
 *         return _BpfLambdaRound(self)
 * 
 *     cpdef _BpfRand rand(self):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf representing rand(self(x))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.rand", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_57rand(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_56rand[] = "BpfInterface.rand(self) -> _BpfRand\n\n        A bpf representing rand(self(x))\n\n        Returns:\n            (BpfInterface) A bpf representing the operation ``rand(self(x))`\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_57rand = {"rand", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_57rand, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_56rand};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_57rand(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rand (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_56rand(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_56rand(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rand", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_rand(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.rand", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1190
 *         return _BpfRand(self)
 * 
 *     cpdef _BpfUnaryFunc cos(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the cosine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 0)
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_59cos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_cos(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cos", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_59cos)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1190, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1192
 *     cpdef _BpfUnaryFunc cos(self):
 *         """Returns a bpf representing the cosine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 0)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc sin(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1190
 *         return _BpfRand(self)
 * 
 *     cpdef _BpfUnaryFunc cos(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the cosine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 0)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_59cos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_58cos[] = "BpfInterface.cos(self) -> _BpfUnaryFunc\nReturns a bpf representing the cosine of this bpf";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_59cos = {"cos", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_59cos, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_58cos};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_59cos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cos (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_58cos(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_58cos(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_cos(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.cos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1194
 *         return _BpfUnaryFunc_new_from_index(self, 0)
 * 
 *     cpdef _BpfUnaryFunc sin(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the sine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 1)
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_61sin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_sin(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sin", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_61sin)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1194, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1194, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1196
 *     cpdef _BpfUnaryFunc sin(self):
 *         """Returns a bpf representing the sine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 1)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc ceil(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1194
 *         return _BpfUnaryFunc_new_from_index(self, 0)
 * 
 *     cpdef _BpfUnaryFunc sin(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the sine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 1)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_61sin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_60sin[] = "BpfInterface.sin(self) -> _BpfUnaryFunc\nReturns a bpf representing the sine of this bpf";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_61sin = {"sin", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_61sin, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_60sin};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_61sin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sin (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_60sin(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_60sin(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_sin(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1198
 *         return _BpfUnaryFunc_new_from_index(self, 1)
 * 
 *     cpdef _BpfUnaryFunc ceil(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the ceil of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 2)
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_63ceil(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_ceil(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_63ceil)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1198, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1200
 *     cpdef _BpfUnaryFunc ceil(self):
 *         """Returns a bpf representing the ceil of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 2)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc expon(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1198
 *         return _BpfUnaryFunc_new_from_index(self, 1)
 * 
 *     cpdef _BpfUnaryFunc ceil(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the ceil of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 2)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_63ceil(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_62ceil[] = "BpfInterface.ceil(self) -> _BpfUnaryFunc\nReturns a bpf representing the ceil of this bpf";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_63ceil = {"ceil", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_63ceil, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_62ceil};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_63ceil(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_62ceil(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_62ceil(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_ceil(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1202
 *         return _BpfUnaryFunc_new_from_index(self, 2)
 * 
 *     cpdef _BpfUnaryFunc expon(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the exp operation with this bpf
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_65expon(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_expon(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("expon", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_expon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_65expon)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1202, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1218
 *         2.718281828459045
 *         """
 *         return _BpfUnaryFunc_new_from_index(self, 4)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc floor(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1202
 *         return _BpfUnaryFunc_new_from_index(self, 2)
 * 
 *     cpdef _BpfUnaryFunc expon(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the exp operation with this bpf
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.expon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_65expon(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_64expon[] = "BpfInterface.expon(self) -> _BpfUnaryFunc\nReturns a bpf representing the exp operation with this bpf\n\n        ## Example\n\n        ```python\n\n        >>> from bpf4 import *\n        >>> a = linear(0, 0, 1, 10)\n        >>> a(0.1)\n        1.0\n        >>> exp(1.0)\n        2.718281828459045\n        >>> a.expon()(0.1)\n        2.718281828459045\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_65expon = {"expon", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_65expon, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_64expon};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_65expon(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("expon (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_64expon(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_64expon(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("expon", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_expon(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.expon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1220
 *         return _BpfUnaryFunc_new_from_index(self, 4)
 * 
 *     cpdef _BpfUnaryFunc floor(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the floor of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 5)
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_67floor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_floor(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1220, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_67floor)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1220, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1220, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1222
 *     cpdef _BpfUnaryFunc floor(self):
 *         """Returns a bpf representing the floor of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 5)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc tanh(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1220
 *         return _BpfUnaryFunc_new_from_index(self, 4)
 * 
 *     cpdef _BpfUnaryFunc floor(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the floor of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 5)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_67floor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_66floor[] = "BpfInterface.floor(self) -> _BpfUnaryFunc\nReturns a bpf representing the floor of this bpf";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_67floor = {"floor", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_67floor, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_66floor};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_67floor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_66floor(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_66floor(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_floor(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1224
 *         return _BpfUnaryFunc_new_from_index(self, 5)
 * 
 *     cpdef _BpfUnaryFunc tanh(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the tanh of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 6)
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_69tanh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_tanh(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tanh", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tanh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_69tanh)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1224, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1226
 *     cpdef _BpfUnaryFunc tanh(self):
 *         """Returns a bpf representing the tanh of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 6)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc abs(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1224
 *         return _BpfUnaryFunc_new_from_index(self, 5)
 * 
 *     cpdef _BpfUnaryFunc tanh(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the tanh of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 6)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_69tanh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_68tanh[] = "BpfInterface.tanh(self) -> _BpfUnaryFunc\nReturns a bpf representing the tanh of this bpf";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_69tanh = {"tanh", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_69tanh, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_68tanh};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_69tanh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tanh (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_68tanh(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_68tanh(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tanh", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_tanh(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.tanh", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1228
 *         return _BpfUnaryFunc_new_from_index(self, 6)
 * 
 *     cpdef _BpfUnaryFunc abs(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the absolute value of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 7)
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_71abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_abs(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("abs", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_abs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_71abs)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1228, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1230
 *     cpdef _BpfUnaryFunc abs(self):
 *         """Returns a bpf representing the absolute value of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 7)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc sqrt(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1228
 *         return _BpfUnaryFunc_new_from_index(self, 6)
 * 
 *     cpdef _BpfUnaryFunc abs(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the absolute value of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 7)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_71abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_70abs[] = "BpfInterface.abs(self) -> _BpfUnaryFunc\nReturns a bpf representing the absolute value of this bpf";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_71abs = {"abs", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_71abs, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_70abs};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_71abs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("abs (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_70abs(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_70abs(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("abs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_abs(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1232
 *         return _BpfUnaryFunc_new_from_index(self, 7)
 * 
 *     cpdef _BpfUnaryFunc sqrt(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the sqrt of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 8)
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_73sqrt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_sqrt(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sqrt", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_73sqrt)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1232, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1232, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1234
 *     cpdef _BpfUnaryFunc sqrt(self):
 *         """Returns a bpf representing the sqrt of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 8)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc acos(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1232
 *         return _BpfUnaryFunc_new_from_index(self, 7)
 * 
 *     cpdef _BpfUnaryFunc sqrt(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the sqrt of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 8)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_73sqrt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_72sqrt[] = "BpfInterface.sqrt(self) -> _BpfUnaryFunc\nReturns a bpf representing the sqrt of this bpf";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_73sqrt = {"sqrt", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_73sqrt, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_72sqrt};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_73sqrt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sqrt (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_72sqrt(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_72sqrt(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sqrt", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_sqrt(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1236
 *         return _BpfUnaryFunc_new_from_index(self, 8)
 * 
 *     cpdef _BpfUnaryFunc acos(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the arc cosine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 9)
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_75acos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_acos(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("acos", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_acos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_75acos)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1236, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1238
 *     cpdef _BpfUnaryFunc acos(self):
 *         """Returns a bpf representing the arc cosine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 9)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc asin(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1236
 *         return _BpfUnaryFunc_new_from_index(self, 8)
 * 
 *     cpdef _BpfUnaryFunc acos(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the arc cosine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 9)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_75acos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_74acos[] = "BpfInterface.acos(self) -> _BpfUnaryFunc\nReturns a bpf representing the arc cosine of this bpf";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_75acos = {"acos", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_75acos, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_74acos};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_75acos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("acos (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_74acos(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_74acos(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("acos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_acos(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.acos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1240
 *         return _BpfUnaryFunc_new_from_index(self, 9)
 * 
 *     cpdef _BpfUnaryFunc asin(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the arc sine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 10)
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_77asin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_asin(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("asin", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_asin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_77asin)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1240, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1242
 *     cpdef _BpfUnaryFunc asin(self):
 *         """Returns a bpf representing the arc sine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 10)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc tan(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1240
 *         return _BpfUnaryFunc_new_from_index(self, 9)
 * 
 *     cpdef _BpfUnaryFunc asin(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the arc sine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 10)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_77asin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_76asin[] = "BpfInterface.asin(self) -> _BpfUnaryFunc\nReturns a bpf representing the arc sine of this bpf";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_77asin = {"asin", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_77asin, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_76asin};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_77asin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("asin (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_76asin(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_76asin(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("asin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_asin(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.asin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1244
 *         return _BpfUnaryFunc_new_from_index(self, 10)
 * 
 *     cpdef _BpfUnaryFunc tan(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the tan of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 11)
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_79tan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_tan(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tan", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_79tan)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1244, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1246
 *     cpdef _BpfUnaryFunc tan(self):
 *         """Returns a bpf representing the tan of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 11)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc sinh(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1244
 *         return _BpfUnaryFunc_new_from_index(self, 10)
 * 
 *     cpdef _BpfUnaryFunc tan(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the tan of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 11)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_79tan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_78tan[] = "BpfInterface.tan(self) -> _BpfUnaryFunc\nReturns a bpf representing the tan of this bpf";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_79tan = {"tan", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_79tan, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_78tan};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_79tan(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tan (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_78tan(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_78tan(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tan", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_tan(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.tan", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1248
 *         return _BpfUnaryFunc_new_from_index(self, 11)
 * 
 *     cpdef _BpfUnaryFunc sinh(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the sinh of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 12)
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_81sinh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_sinh(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sinh", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sinh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_81sinh)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1248, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1248, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1250
 *     cpdef _BpfUnaryFunc sinh(self):
 *         """Returns a bpf representing the sinh of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 12)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfUnaryFunc log10(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1248
 *         return _BpfUnaryFunc_new_from_index(self, 11)
 * 
 *     cpdef _BpfUnaryFunc sinh(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the sinh of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 12)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_81sinh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_80sinh[] = "BpfInterface.sinh(self) -> _BpfUnaryFunc\nReturns a bpf representing the sinh of this bpf";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_81sinh = {"sinh", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_81sinh, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_80sinh};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_81sinh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sinh (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_80sinh(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_80sinh(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sinh", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_sinh(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.sinh", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1252
 *         return _BpfUnaryFunc_new_from_index(self, 12)
 * 
 *     cpdef _BpfUnaryFunc log10(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the log10 of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 13)
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_83log10(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core_12BpfInterface_log10(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("log10", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_log10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_83log10)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1252, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfUnaryFunc))))) __PYX_ERR(0, 1252, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1254
 *     cpdef _BpfUnaryFunc log10(self):
 *         """Returns a bpf representing the log10 of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 13)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfLambdaLog log(self, double base=M_E):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(__pyx_v_self, 13)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1252
 *         return _BpfUnaryFunc_new_from_index(self, 12)
 * 
 *     cpdef _BpfUnaryFunc log10(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the log10 of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 13)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.log10", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_83log10(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_82log10[] = "BpfInterface.log10(self) -> _BpfUnaryFunc\nReturns a bpf representing the log10 of this bpf";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_83log10 = {"log10", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_83log10, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_82log10};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_83log10(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("log10 (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_82log10(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_82log10(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("log10", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_log10(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.log10", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1256
 *         return _BpfUnaryFunc_new_from_index(self, 13)
 * 
 *     cpdef _BpfLambdaLog log(self, double base=M_E):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing the log of this bpf
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_85log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfLambdaLog *__pyx_f_4bpf4_4core_12BpfInterface_log(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_log *__pyx_optional_args) {
  double __pyx_v_base = __pyx_k__7;
  struct __pyx_obj_4bpf4_4core__BpfLambdaLog *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("log", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_base = __pyx_optional_args->base;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_log); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_85log)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1256, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfLambdaLog))))) __PYX_ERR(0, 1256, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfLambdaLog *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1267
 * 
 *         """
 *         return _BpfLambdaLog(self, base, self.bounds())             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfM2F m2f(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bounds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaLog), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfLambdaLog *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1256
 *         return _BpfUnaryFunc_new_from_index(self, 13)
 * 
 *     cpdef _BpfLambdaLog log(self, double base=M_E):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing the log of this bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_85log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_84log[] = "BpfInterface.log(self, double base=M_E) -> _BpfLambdaLog\n\n        Returns a bpf representing the log of this bpf\n\n        Args:\n            base (float): the base of the log\n\n        Returns:\n            (BpfInterface) A bpf representing `\\x -> log(self(x), base)`\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_85log = {"log", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_85log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_84log};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_85log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_base;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("log (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_base,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "log") < 0)) __PYX_ERR(0, 1256, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_base = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_base == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1256, __pyx_L3_error)
    } else {
      __pyx_v_base = __pyx_k__7;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("log", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1256, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_84log(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_base);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_84log(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_base) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_log __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("log", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.base = __pyx_v_base;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_BpfInterface->log(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.log", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1269
 *         return _BpfLambdaLog(self, base, self.bounds())
 * 
 *     cpdef _BpfM2F m2f(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf converting from midinotes to frequency
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_87m2f(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfM2F *__pyx_f_4bpf4_4core_12BpfInterface_m2f(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfM2F *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("m2f", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_m2f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_87m2f)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1269, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfM2F))))) __PYX_ERR(0, 1269, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfM2F *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1287
 *         ```
 *         """
 *         return _BpfM2F(self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfF2M f2m(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfM2F), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfM2F *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1269
 *         return _BpfLambdaLog(self, base, self.bounds())
 * 
 *     cpdef _BpfM2F m2f(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf converting from midinotes to frequency
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.m2f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_87m2f(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_86m2f[] = "BpfInterface.m2f(self) -> _BpfM2F\nReturns a bpf converting from midinotes to frequency\n\n        Returns:\n            (BpfInterface) A bpf representing `\\x -> m2f(self(x))`\n\n        ## Example\n\n        ```python\n        >>> from bpf4 import *\n        >>> midinotes = linear(0, 60, 1, 65)\n        >>> freqs = midinotes.m2f()\n        >>> freqs.map(10)\n        array([262.81477242, 271.38531671, 280.23535149, 289.37399111,\n               298.81064715, 308.55503809, 318.61719934, 329.0074936 ,\n               339.73662146, 350.81563248])\n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_87m2f = {"m2f", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_87m2f, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_86m2f};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_87m2f(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("m2f (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_86m2f(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_86m2f(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("m2f", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_m2f(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.m2f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1289
 *         return _BpfM2F(self)
 * 
 *     cpdef _BpfF2M f2m(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf converting frequencies to midinotes
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_89f2m(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfF2M *__pyx_f_4bpf4_4core_12BpfInterface_f2m(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfF2M *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("f2m", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_f2m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_89f2m)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1289, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfF2M))))) __PYX_ERR(0, 1289, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfF2M *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1305
 *         ```
 *         """
 *         return _BpfF2M(self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _Bpf_db2amp db2amp(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfF2M), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfF2M *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1289
 *         return _BpfM2F(self)
 * 
 *     cpdef _BpfF2M f2m(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf converting frequencies to midinotes
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.f2m", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_89f2m(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_88f2m[] = "BpfInterface.f2m(self) -> _BpfF2M\nReturns a bpf converting frequencies to midinotes\n        \n        Returns:\n            (BpfInterface) A bpf representing `\\x -> f2m(self(x))`\n\n        ## Example\n        \n        ```python\n        >>> from bpf4 import *\n        >>> freqs = linear(0, 442, 1, 882)\n        >>> freqs.f2m().map(10)\n        array([69.        , 70.82403712, 72.47407941, 73.98044999, 75.3661766 ,\n               76.64915905, 77.84358713, 78.96089998, 80.01045408, 81.        ])\n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_89f2m = {"f2m", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_89f2m, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_88f2m};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_89f2m(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("f2m (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_88f2m(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_88f2m(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("f2m", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_f2m(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.f2m", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1307
 *         return _BpfF2M(self)
 * 
 *     cpdef _Bpf_db2amp db2amp(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf converting decibels to linear amplitudes
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_91db2amp(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__Bpf_db2amp *__pyx_f_4bpf4_4core_12BpfInterface_db2amp(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__Bpf_db2amp *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("db2amp", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_db2amp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_91db2amp)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__Bpf_db2amp))))) __PYX_ERR(0, 1307, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__Bpf_db2amp *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1322
 *         ```
 *         """
 *         return _Bpf_db2amp(self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _Bpf_amp2db amp2db(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4bpf4_4core__Bpf_db2amp), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__Bpf_db2amp *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1307
 *         return _BpfF2M(self)
 * 
 *     cpdef _Bpf_db2amp db2amp(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf converting decibels to linear amplitudes
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.db2amp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_91db2amp(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_90db2amp[] = "BpfInterface.db2amp(self) -> _Bpf_db2amp\n\n        Returns a bpf converting decibels to linear amplitudes\n\n        Returns:\n            (BpfInterface) A bpf representing `\\x -> db2amp(self(x))`\n\n        ## Example\n\n        ```python\n        >>> linear(0, 0, 1, -60).db2amp().map(10)\n        array([1.        , 0.46415888, 0.21544347, 0.1       , 0.04641589,\n               0.02154435, 0.01      , 0.00464159, 0.00215443, 0.001     ])\n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_91db2amp = {"db2amp", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_91db2amp, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_90db2amp};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_91db2amp(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("db2amp (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_90db2amp(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_90db2amp(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("db2amp", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_db2amp(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.db2amp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1324
 *         return _Bpf_db2amp(self)
 * 
 *     cpdef _Bpf_amp2db amp2db(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf converting linear amplitudes to decibels
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_93amp2db(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core__Bpf_amp2db *__pyx_f_4bpf4_4core_12BpfInterface_amp2db(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__Bpf_amp2db *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("amp2db", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_amp2db); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_93amp2db)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1324, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__Bpf_amp2db))))) __PYX_ERR(0, 1324, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__Bpf_amp2db *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1340
 *         ```
 *         """
 *         return _Bpf_amp2db(self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfLambdaClip clip(self, double y0=INFNEG, double y1=INF):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4bpf4_4core__Bpf_amp2db), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__Bpf_amp2db *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1324
 *         return _Bpf_db2amp(self)
 * 
 *     cpdef _Bpf_amp2db amp2db(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf converting linear amplitudes to decibels
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.amp2db", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_93amp2db(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_92amp2db[] = "BpfInterface.amp2db(self) -> _Bpf_amp2db\n\n        Returns a bpf converting linear amplitudes to decibels\n\n        Returns:\n            (BpfInterface) A bpf representing `\\x -> amp2db(self(x))`\n\n        ## Example\n\n        ```python\n        >>> linear(0, 0, 1, 1).amp2db().map(10)\n        array([-280.        ,  -19.08485019,  -13.06425028,   -9.54242509,\n               -7.04365036,   -5.1054501 ,   -3.52182518,   -2.18288939,\n               -1.02305045,    0.        ])\n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_93amp2db = {"amp2db", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_93amp2db, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_92amp2db};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_93amp2db(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("amp2db (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_92amp2db(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_92amp2db(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("amp2db", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_amp2db(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.amp2db", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1342
 *         return _Bpf_amp2db(self)
 * 
 *     cpdef _BpfLambdaClip clip(self, double y0=INFNEG, double y1=INF):             # <<<<<<<<<<<<<<
 *         """
 *         Return a bpf clipping the result between y0 and y1
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_95clip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_f_4bpf4_4core_12BpfInterface_clip(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_clip *__pyx_optional_args) {
  double __pyx_v_y0 = ((double)(-Py_HUGE_VAL));
  double __pyx_v_y1 = ((double)Py_HUGE_VAL);
  struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clip", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_y0 = __pyx_optional_args->y0;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_y1 = __pyx_optional_args->y1;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_95clip)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_y1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1342, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfLambdaClip))))) __PYX_ERR(0, 1342, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfLambdaClip *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1366
 *         ![](assets/clip1.png)
 *         """
 *         return _BpfLambdaClip_new(self, y0, y1)             # <<<<<<<<<<<<<<
 * 
 *     cpdef BpfInterface derivative(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfLambdaClip_new(__pyx_v_self, __pyx_v_y0, __pyx_v_y1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfLambdaClip *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1342
 *         return _Bpf_amp2db(self)
 * 
 *     cpdef _BpfLambdaClip clip(self, double y0=INFNEG, double y1=INF):             # <<<<<<<<<<<<<<
 *         """
 *         Return a bpf clipping the result between y0 and y1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.clip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_95clip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_94clip[] = "BpfInterface.clip(self, double y0=-inf, double y1=inf) -> _BpfLambdaClip\n\n        Return a bpf clipping the result between y0 and y1\n\n        Args:\n            y0 (float): the min. *y* value\n            y1 (float): the max. *y* value\n\n        Returns:\n            (BpfInterface) A view of this bpf clipped to the given\n            *y* values\n\n        ```python\n\n        >>> a = linear(0, -1, 1, 1).clip(0, 1)\n        >>> a.map(20)\n        array([0.        , 0.        , 0.        , 0.        , 0.        ,\n               0.        , 0.        , 0.        , 0.        , 0.        ,\n               0.05263158, 0.15789474, 0.26315789, 0.36842105, 0.47368421,\n               0.57894737, 0.68421053, 0.78947368, 0.89473684, 1.        ])\n        >>> a.plot()\n        ```\n        ![](assets/clip1.png)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_95clip = {"clip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_95clip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_94clip};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_95clip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_y0;
  double __pyx_v_y1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clip (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y0,&__pyx_n_s_y1,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y0);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clip") < 0)) __PYX_ERR(0, 1342, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_y0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_y0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1342, __pyx_L3_error)
    } else {
      __pyx_v_y0 = ((double)(-Py_HUGE_VAL));
    }
    if (values[1]) {
      __pyx_v_y1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_y1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1342, __pyx_L3_error)
    } else {
      __pyx_v_y1 = ((double)Py_HUGE_VAL);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clip", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1342, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.clip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_94clip(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_y0, __pyx_v_y1);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_94clip(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_y0, double __pyx_v_y1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_clip __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clip", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.y0 = __pyx_v_y0;
  __pyx_t_2.y1 = __pyx_v_y1;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_BpfInterface->clip(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.clip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1368
 *         return _BpfLambdaClip_new(self, y0, y1)
 * 
 *     cpdef BpfInterface derivative(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create a curve which represents the derivative of this curve
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_97derivative(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_derivative(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("derivative", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_derivative); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_97derivative)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 1368, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1399
 *         ![](assets/derivative1.png)
 *         """
 *         return _BpfDeriv(self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef BpfInterface integrated(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfDeriv), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1368
 *         return _BpfLambdaClip_new(self, y0, y1)
 * 
 *     cpdef BpfInterface derivative(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create a curve which represents the derivative of this curve
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_97derivative(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_96derivative[] = "BpfInterface.derivative(self) -> BpfInterface\n\n        Create a curve which represents the derivative of this curve\n\n        Returns:\n            (BpfInterface) A bpf which returns the derivative of this \n            bpf at any given x coord\n\n        It implements Newtons difference quotiont, so that:\n\n        ```\n\n                        bpf(x + h) - bpf(x)\n        derivative(x) = -------------------\n                                  h\n        ```\n\n        Example\n        -------\n\n        ```python\n        \n        >>> from bpf4 import *\n        >>> a = slope(1)[0:6.28].sin()\n        >>> a.plot(show=False, color=\"red\")\n        >>> b = a.derivative()\n        >>> b.plot(color=\"blue\")\n\n        ```\n        ![](assets/derivative1.png)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_97derivative = {"derivative", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_97derivative, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_96derivative};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_97derivative(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("derivative (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_96derivative(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_96derivative(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("derivative", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_derivative(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1401
 *         return _BpfDeriv(self)
 * 
 *     cpdef BpfInterface integrated(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a bpf representing the integration of this bpf at a given point
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_99integrated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_integrated(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrated", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrated); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_99integrated)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 1401, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1424
 *         """
 * 
 *         if self._x0 == INFNEG:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot integrate a function with an infinite negative bound")
 *         return _BpfIntegrate(self)
 */
  __pyx_t_5 = ((__pyx_v_self->_x0 == (-Py_HUGE_VAL)) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "bpf4/core.pyx":1425
 * 
 *         if self._x0 == INFNEG:
 *             raise ValueError("Cannot integrate a function with an infinite negative bound")             # <<<<<<<<<<<<<<
 *         return _BpfIntegrate(self)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1425, __pyx_L1_error)

    /* "bpf4/core.pyx":1424
 *         """
 * 
 *         if self._x0 == INFNEG:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot integrate a function with an infinite negative bound")
 *         return _BpfIntegrate(self)
 */
  }

  /* "bpf4/core.pyx":1426
 *         if self._x0 == INFNEG:
 *             raise ValueError("Cannot integrate a function with an infinite negative bound")
 *         return _BpfIntegrate(self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef double integrate(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfIntegrate), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1401
 *         return _BpfDeriv(self)
 * 
 *     cpdef BpfInterface integrated(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a bpf representing the integration of this bpf at a given point
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.integrated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_99integrated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_98integrated[] = "BpfInterface.integrated(self) -> BpfInterface\n\n        Return a bpf representing the integration of this bpf at a given point\n\n        Returns:\n            (BpfInterface) A bpf representing the integration of this bpf\n\n        Example\n        -------\n\n        ```python\n        a = linear(0, 0, 5, 5)\n        b = a.integrated()\n        a.plot(show=False, color=\"red\")\n        b.plot(color=\"blue\")\n        ```\n        ![](assets/integrated1.png)\n\n        !!! info \"See Also\"\n\n            * [.integrate](#integrate)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_99integrated = {"integrated", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_99integrated, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_98integrated};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_99integrated(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrated (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_98integrated(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_98integrated(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrated", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_integrated(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.integrated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1428
 *         return _BpfIntegrate(self)
 * 
 *     cpdef double integrate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the result of the integration of this bpf.
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_101integrate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static double __pyx_f_4bpf4_4core_12BpfInterface_integrate(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_101integrate)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1428, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1428, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1448
 *         ```
 *         """
 *         if isinf(self._x0) or isinf(self._x1):             # <<<<<<<<<<<<<<
 *             return INFINITY
 *         return self.integrate_between(self._x0, self._x1)
 */
  __pyx_t_7 = (isinf(__pyx_v_self->_x0) != 0);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = (isinf(__pyx_v_self->_x1) != 0);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_6) {

    /* "bpf4/core.pyx":1449
 *         """
 *         if isinf(self._x0) or isinf(self._x1):
 *             return INFINITY             # <<<<<<<<<<<<<<
 *         return self.integrate_between(self._x0, self._x1)
 * 
 */
    __pyx_r = INFINITY;
    goto __pyx_L0;

    /* "bpf4/core.pyx":1448
 *         ```
 *         """
 *         if isinf(self._x0) or isinf(self._x1):             # <<<<<<<<<<<<<<
 *             return INFINITY
 *         return self.integrate_between(self._x0, self._x1)
 */
  }

  /* "bpf4/core.pyx":1450
 *         if isinf(self._x0) or isinf(self._x1):
 *             return INFINITY
 *         return self.integrate_between(self._x0, self._x1)             # <<<<<<<<<<<<<<
 * 
 *     cpdef double trapz_integrate_between(self, double x0, double x1, size_t N=0):
 */
  __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->integrate_between(__pyx_v_self, __pyx_v_self->_x0, __pyx_v_self->_x1, 0, NULL);
  goto __pyx_L0;

  /* "bpf4/core.pyx":1428
 *         return _BpfIntegrate(self)
 * 
 *     cpdef double integrate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the result of the integration of this bpf.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("bpf4.core.BpfInterface.integrate", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_101integrate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_100integrate[] = "BpfInterface.integrate(self) -> double\n\n        Return the result of the integration of this bpf. \n\n        If any of the bounds is inf, the result is also inf.\n\n        **NB**: to set the bounds of the integration, first crop the bpf via a slice\n        \n        Returns:\n            (float) The result of the integration\n\n        ## Example\n\n        ```python\n\n        >>> linear(0, 0, 10, 10).sin()[0:2*pi].integrate()\n        -1.7099295055304798e-17\n        \n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_101integrate = {"integrate", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_101integrate, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_100integrate};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_101integrate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_100integrate(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_100integrate(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_4bpf4_4core_12BpfInterface_integrate(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.integrate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1452
 *         return self.integrate_between(self._x0, self._x1)
 * 
 *     cpdef double trapz_integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between [x0, x1] using the trapt method
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_103trapz_integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_4bpf4_4core_12BpfInterface_trapz_integrate_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_trapz_integrate_between *__pyx_optional_args) {
  size_t __pyx_v_N = ((size_t)0);
  double __pyx_v_dx;
  __Pyx_memviewslice __pyx_v_ys = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_t_11;
  size_t __pyx_t_12;
  __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trapz_integrate_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trapz_integrate_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_103trapz_integrate_between)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1452, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1452, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1452, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1452, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1452, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1452, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1452, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1468
 *             double dx
 *             double [::1] ys
 *         if N == 0:             # <<<<<<<<<<<<<<
 *             N = CONFIG['integrate.trapz_intervals']
 *         dx = (x1 - x0) / N
 */
  __pyx_t_11 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":1469
 *             double [::1] ys
 *         if N == 0:
 *             N = CONFIG['integrate.trapz_intervals']             # <<<<<<<<<<<<<<
 *         dx = (x1 - x0) / N
 *         if dx <= 0:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CONFIG); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_kp_u_integrate_trapz_intervals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1469, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_N = __pyx_t_12;

    /* "bpf4/core.pyx":1468
 *             double dx
 *             double [::1] ys
 *         if N == 0:             # <<<<<<<<<<<<<<
 *             N = CONFIG['integrate.trapz_intervals']
 *         dx = (x1 - x0) / N
 */
  }

  /* "bpf4/core.pyx":1470
 *         if N == 0:
 *             N = CONFIG['integrate.trapz_intervals']
 *         dx = (x1 - x0) / N             # <<<<<<<<<<<<<<
 *         if dx <= 0:
 *             return 0.0
 */
  __pyx_t_10 = (__pyx_v_x1 - __pyx_v_x0);
  if (unlikely(__pyx_v_N == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1470, __pyx_L1_error)
  }
  __pyx_v_dx = (__pyx_t_10 / ((double)__pyx_v_N));

  /* "bpf4/core.pyx":1471
 *             N = CONFIG['integrate.trapz_intervals']
 *         dx = (x1 - x0) / N
 *         if dx <= 0:             # <<<<<<<<<<<<<<
 *             return 0.0
 *         ys = self.sample_between(x0, x1, dx)
 */
  __pyx_t_11 = ((__pyx_v_dx <= 0.0) != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":1472
 *         dx = (x1 - x0) / N
 *         if dx <= 0:
 *             return 0.0             # <<<<<<<<<<<<<<
 *         ys = self.sample_between(x0, x1, dx)
 *         return _integr_trapz(&ys[0], ys.shape[0], dx)
 */
    __pyx_r = 0.0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":1471
 *             N = CONFIG['integrate.trapz_intervals']
 *         dx = (x1 - x0) / N
 *         if dx <= 0:             # <<<<<<<<<<<<<<
 *             return 0.0
 *         ys = self.sample_between(x0, x1, dx)
 */
  }

  /* "bpf4/core.pyx":1473
 *         if dx <= 0:
 *             return 0.0
 *         ys = self.sample_between(x0, x1, dx)             # <<<<<<<<<<<<<<
 *         return _integr_trapz(&ys[0], ys.shape[0], dx)
 * 
 */
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->sample_between(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, __pyx_v_dx, 0, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 1473, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_ys = __pyx_t_13;
  __pyx_t_13.memview = NULL;
  __pyx_t_13.data = NULL;

  /* "bpf4/core.pyx":1474
 *             return 0.0
 *         ys = self.sample_between(x0, x1, dx)
 *         return _integr_trapz(&ys[0], ys.shape[0], dx)             # <<<<<<<<<<<<<<
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 */
  __pyx_t_14 = 0;
  __pyx_r = __pyx_f_4bpf4_4core__integr_trapz((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_ys.data) + __pyx_t_14)) )))), (__pyx_v_ys.shape[0]), __pyx_v_dx);
  goto __pyx_L0;

  /* "bpf4/core.pyx":1452
 *         return self.integrate_between(self._x0, self._x1)
 * 
 *     cpdef double trapz_integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between [x0, x1] using the trapt method
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
  __Pyx_WriteUnraisable("bpf4.core.BpfInterface.trapz_integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_ys, 1);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_103trapz_integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_102trapz_integrate_between[] = "BpfInterface.trapz_integrate_between(self, double x0, double x1, size_t N=0) -> double\n\n        Integrate this bpf between [x0, x1] using the trapt method\n\n        Args:\n            x0 (float): start of integration period\n            x1 (float): end of the integration period\n            N (int): number of subdivisions used to calculate the integral. If not given, \n               a default is used (default defined in `CONFIG['integrate.trapz_intervals']`)\n\n        Returns:\n            (float) The result of the integration\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_103trapz_integrate_between = {"trapz_integrate_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_103trapz_integrate_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_102trapz_integrate_between};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_103trapz_integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  size_t __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("trapz_integrate_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("trapz_integrate_between", 0, 2, 3, 1); __PYX_ERR(0, 1452, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "trapz_integrate_between") < 0)) __PYX_ERR(0, 1452, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1452, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1452, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_N == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1452, __pyx_L3_error)
    } else {
      __pyx_v_N = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("trapz_integrate_between", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1452, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.trapz_integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_102trapz_integrate_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_102trapz_integrate_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_trapz_integrate_between __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trapz_integrate_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core_BpfInterface->trapz_integrate_between(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2); 
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.trapz_integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1476
 *         return _integr_trapz(&ys[0], ys.shape[0], dx)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between x0 and x1
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_105integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_4bpf4_4core_12BpfInterface_integrate_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args) {
  size_t __pyx_v_N = ((size_t)0);
  int __pyx_v_mode;
  double __pyx_v_outbound0;
  double __pyx_v_outbound1;
  double __pyx_v_inbound;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_t_11;
  struct __pyx_opt_args_4bpf4_4core_integrate_simpsons __pyx_t_12;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_trapz_integrate_between __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_105integrate_between)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1476, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1476, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1476, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1476, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1476, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1491
 *         cdef double out
 *         cdef int get_mode
 *         cdef int mode = self._integration_mode             # <<<<<<<<<<<<<<
 *         cdef double outbound0, outbound1, inbound
 *         if x1 > self._x1:
 */
  __pyx_t_8 = __pyx_v_self->_integration_mode;
  __pyx_v_mode = __pyx_t_8;

  /* "bpf4/core.pyx":1493
 *         cdef int mode = self._integration_mode
 *         cdef double outbound0, outbound1, inbound
 *         if x1 > self._x1:             # <<<<<<<<<<<<<<
 *             outbound1 = self.__ccall__(x1) * (x1 - self._x1)
 *             x1 = self._x1
 */
  __pyx_t_11 = ((__pyx_v_x1 > __pyx_v_self->_x1) != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":1494
 *         cdef double outbound0, outbound1, inbound
 *         if x1 > self._x1:
 *             outbound1 = self.__ccall__(x1) * (x1 - self._x1)             # <<<<<<<<<<<<<<
 *             x1 = self._x1
 *         else:
 */
    __pyx_v_outbound1 = (((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->__pyx___ccall__(__pyx_v_self, __pyx_v_x1) * (__pyx_v_x1 - __pyx_v_self->_x1));

    /* "bpf4/core.pyx":1495
 *         if x1 > self._x1:
 *             outbound1 = self.__ccall__(x1) * (x1 - self._x1)
 *             x1 = self._x1             # <<<<<<<<<<<<<<
 *         else:
 *             outbound1 = 0
 */
    __pyx_t_10 = __pyx_v_self->_x1;
    __pyx_v_x1 = __pyx_t_10;

    /* "bpf4/core.pyx":1493
 *         cdef int mode = self._integration_mode
 *         cdef double outbound0, outbound1, inbound
 *         if x1 > self._x1:             # <<<<<<<<<<<<<<
 *             outbound1 = self.__ccall__(x1) * (x1 - self._x1)
 *             x1 = self._x1
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":1497
 *             x1 = self._x1
 *         else:
 *             outbound1 = 0             # <<<<<<<<<<<<<<
 *         if x0 < self._x0:
 *             outbound0 = self.__ccall__(x0) * (self._x0 - x0)
 */
  /*else*/ {
    __pyx_v_outbound1 = 0.0;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":1498
 *         else:
 *             outbound1 = 0
 *         if x0 < self._x0:             # <<<<<<<<<<<<<<
 *             outbound0 = self.__ccall__(x0) * (self._x0 - x0)
 *             x0 = self._x0
 */
  __pyx_t_11 = ((__pyx_v_x0 < __pyx_v_self->_x0) != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":1499
 *             outbound1 = 0
 *         if x0 < self._x0:
 *             outbound0 = self.__ccall__(x0) * (self._x0 - x0)             # <<<<<<<<<<<<<<
 *             x0 = self._x0
 *         else:
 */
    __pyx_v_outbound0 = (((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->__pyx___ccall__(__pyx_v_self, __pyx_v_x0) * (__pyx_v_self->_x0 - __pyx_v_x0));

    /* "bpf4/core.pyx":1500
 *         if x0 < self._x0:
 *             outbound0 = self.__ccall__(x0) * (self._x0 - x0)
 *             x0 = self._x0             # <<<<<<<<<<<<<<
 *         else:
 *             outbound0 = 0
 */
    __pyx_t_10 = __pyx_v_self->_x0;
    __pyx_v_x0 = __pyx_t_10;

    /* "bpf4/core.pyx":1498
 *         else:
 *             outbound1 = 0
 *         if x0 < self._x0:             # <<<<<<<<<<<<<<
 *             outbound0 = self.__ccall__(x0) * (self._x0 - x0)
 *             x0 = self._x0
 */
    goto __pyx_L4;
  }

  /* "bpf4/core.pyx":1502
 *             x0 = self._x0
 *         else:
 *             outbound0 = 0             # <<<<<<<<<<<<<<
 *         # override mode when N is given
 *         if N > 0:
 */
  /*else*/ {
    __pyx_v_outbound0 = 0.0;
  }
  __pyx_L4:;

  /* "bpf4/core.pyx":1504
 *             outbound0 = 0
 *         # override mode when N is given
 *         if N > 0:             # <<<<<<<<<<<<<<
 *             mode = 0
 *         if mode == 1 or mode == 2:
 */
  __pyx_t_11 = ((__pyx_v_N > 0) != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":1505
 *         # override mode when N is given
 *         if N > 0:
 *             mode = 0             # <<<<<<<<<<<<<<
 *         if mode == 1 or mode == 2:
 *             inbound = integrate_simpsons(self, x0, x1, SIMPSONS_ACCURACY, SIMPSONS_MAXITER)
 */
    __pyx_v_mode = 0;

    /* "bpf4/core.pyx":1504
 *             outbound0 = 0
 *         # override mode when N is given
 *         if N > 0:             # <<<<<<<<<<<<<<
 *             mode = 0
 *         if mode == 1 or mode == 2:
 */
  }

  /* "bpf4/core.pyx":1506
 *         if N > 0:
 *             mode = 0
 *         if mode == 1 or mode == 2:             # <<<<<<<<<<<<<<
 *             inbound = integrate_simpsons(self, x0, x1, SIMPSONS_ACCURACY, SIMPSONS_MAXITER)
 *         else:
 */
  switch (__pyx_v_mode) {
    case 1:
    case 2:

    /* "bpf4/core.pyx":1507
 *             mode = 0
 *         if mode == 1 or mode == 2:
 *             inbound = integrate_simpsons(self, x0, x1, SIMPSONS_ACCURACY, SIMPSONS_MAXITER)             # <<<<<<<<<<<<<<
 *         else:
 *             inbound = self.trapz_integrate_between(x0, x1, N)
 */
    __pyx_t_12.__pyx_n = 2;
    __pyx_t_12.accuracy = 1e-10;
    __pyx_t_12.max_iterations = 0x64;
    __pyx_t_10 = __pyx_f_4bpf4_4core_integrate_simpsons(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, &__pyx_t_12); 
    __pyx_v_inbound = __pyx_t_10;

    /* "bpf4/core.pyx":1506
 *         if N > 0:
 *             mode = 0
 *         if mode == 1 or mode == 2:             # <<<<<<<<<<<<<<
 *             inbound = integrate_simpsons(self, x0, x1, SIMPSONS_ACCURACY, SIMPSONS_MAXITER)
 *         else:
 */
    break;
    default:

    /* "bpf4/core.pyx":1509
 *             inbound = integrate_simpsons(self, x0, x1, SIMPSONS_ACCURACY, SIMPSONS_MAXITER)
 *         else:
 *             inbound = self.trapz_integrate_between(x0, x1, N)             # <<<<<<<<<<<<<<
 *         return outbound0 + inbound + outbound1
 * 
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.N = __pyx_v_N;
    __pyx_t_10 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->trapz_integrate_between(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_13); 
    __pyx_v_inbound = __pyx_t_10;
    break;
  }

  /* "bpf4/core.pyx":1510
 *         else:
 *             inbound = self.trapz_integrate_between(x0, x1, N)
 *         return outbound0 + inbound + outbound1             # <<<<<<<<<<<<<<
 * 
 *     cpdef double mean(self):
 */
  __pyx_r = ((__pyx_v_outbound0 + __pyx_v_inbound) + __pyx_v_outbound1);
  goto __pyx_L0;

  /* "bpf4/core.pyx":1476
 *         return _integr_trapz(&ys[0], ys.shape[0], dx)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between x0 and x1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("bpf4.core.BpfInterface.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_105integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_104integrate_between[] = "BpfInterface.integrate_between(self, double x0, double x1, size_t N=0) -> double\n\n        Integrate this bpf between x0 and x1\n\n        Args:\n            x0: start x of the integration range\n            x1: end x of the integration range\n            N: number of intervals to use for integration\n\n        Returns:\n            (float) The result of the integration\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_105integrate_between = {"integrate_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_105integrate_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_104integrate_between};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_105integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  size_t __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, 1); __PYX_ERR(0, 1476, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_between") < 0)) __PYX_ERR(0, 1476, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1476, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1476, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_N == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1476, __pyx_L3_error)
    } else {
      __pyx_v_N = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1476, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_104integrate_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_104integrate_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core_BpfInterface->integrate_between(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2); 
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1512
 *         return outbound0 + inbound + outbound1
 * 
 *     cpdef double mean(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the mean value of this bpf.
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_107mean(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static double __pyx_f_4bpf4_4core_12BpfInterface_mean(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  double __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mean", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mean); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_107mean)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1512, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1512, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1527
 *         ```
 *         """
 *         return self.integrate() / (self._x1 - self._x0)             # <<<<<<<<<<<<<<
 * 
 *     cpdef list zeros(self, double h=0.01, int N=0, double x0=NAN, double x1=NAN, int maxzeros=0):
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->integrate(__pyx_v_self, 0);
  __pyx_t_6 = (__pyx_v_self->_x1 - __pyx_v_self->_x0);
  if (unlikely(__pyx_t_6 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1527, __pyx_L1_error)
  }
  __pyx_r = (__pyx_t_5 / __pyx_t_6);
  goto __pyx_L0;

  /* "bpf4/core.pyx":1512
 *         return outbound0 + inbound + outbound1
 * 
 *     cpdef double mean(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the mean value of this bpf.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("bpf4.core.BpfInterface.mean", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_107mean(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_106mean[] = "BpfInterface.mean(self) -> double\n\n        Calculate the mean value of this bpf. \n\n        Returns:\n            (float) The average value of this bpf along its bounds\n\n        To constrain the calculation to a given portion, use:\n\n        ```python\n\n        bpf.integrate_between(start, end) / (end-start)\n        \n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_107mean = {"mean", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_107mean, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_106mean};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_107mean(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mean (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_106mean(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_106mean(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mean", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_4bpf4_4core_12BpfInterface_mean(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.mean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1529
 *         return self.integrate() / (self._x1 - self._x0)
 * 
 *     cpdef list zeros(self, double h=0.01, int N=0, double x0=NAN, double x1=NAN, int maxzeros=0):             # <<<<<<<<<<<<<<
 *         """
 *         Find the zeros of this bpf
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_109zeros(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4bpf4_4core_12BpfInterface_zeros(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_zeros *__pyx_optional_args) {
  double __pyx_v_h = ((double)0.01);
  int __pyx_v_N = ((int)0);
  double __pyx_v_x0 = __pyx_k__9;
  double __pyx_v_x1 = __pyx_k__10;
  int __pyx_v_maxzeros = ((int)0);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  struct __pyx_opt_args_4bpf4_4core_bpf_zero_crossings __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zeros", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_h = __pyx_optional_args->h;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_N = __pyx_optional_args->N;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_x0 = __pyx_optional_args->x0;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_x1 = __pyx_optional_args->x1;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_maxzeros = __pyx_optional_args->maxzeros;
            }
          }
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1529, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_109zeros)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_maxzeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_8 = __pyx_t_1; __pyx_t_9 = NULL;
        __pyx_t_10 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
            __pyx_t_10 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1529, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1529, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1529, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_6);
          PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_6 = 0;
          __pyx_t_7 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1529, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1529, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1558
 * 
 *         """
 *         return bpf_zero_crossings(self, h=h, N=N, x0=x0, x1=x1, maxzeros=maxzeros)             # <<<<<<<<<<<<<<
 * 
 *     def max(self, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_12.__pyx_n = 5;
  __pyx_t_12.h = __pyx_v_h;
  __pyx_t_12.N = __pyx_v_N;
  __pyx_t_12.x0 = __pyx_v_x0;
  __pyx_t_12.x1 = __pyx_v_x1;
  __pyx_t_12.maxzeros = __pyx_v_maxzeros;
  __pyx_t_1 = __pyx_f_4bpf4_4core_bpf_zero_crossings(__pyx_v_self, 0, &__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1529
 *         return self.integrate() / (self._x1 - self._x0)
 * 
 *     cpdef list zeros(self, double h=0.01, int N=0, double x0=NAN, double x1=NAN, int maxzeros=0):             # <<<<<<<<<<<<<<
 *         """
 *         Find the zeros of this bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.zeros", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_109zeros(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_108zeros[] = "BpfInterface.zeros(self, double h=0.01, int N=0, double x0=NAN, double x1=NAN, int maxzeros=0) -> list\n\n        Find the zeros of this bpf\n        \n        Args:\n            h: the accuracy to scan for zero-crossings. If two zeros are within \n                this distance, they will be resolved as one.\n            N: alternatively, you can give the number of intervals to scan. \n                h will be derived from this\n            x0: the point to start searching. If not given, the starting point of this bpf\n                will be used\n            x1: the point to stop searching. If not given, the end point of this bpf is used\n            maxzeros: if > 0, stop the search when this number of zeros have been found\n            \n        Returns:\n            (List[float]) A list with the zeros of this bpf\n\n\n        ## Example\n        \n        ```python\n        \n        >>> a = bpf.linear(0, -1, 1, 1)\n        >>> a.zeros()\n        [0.5]\n        \n        ```\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_109zeros = {"zeros", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_109zeros, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_108zeros};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_109zeros(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_h;
  int __pyx_v_N;
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_v_maxzeros;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zeros (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_N,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_maxzeros,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxzeros);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zeros") < 0)) __PYX_ERR(0, 1529, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_h = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_h == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1529, __pyx_L3_error)
    } else {
      __pyx_v_h = ((double)0.01);
    }
    if (values[1]) {
      __pyx_v_N = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1529, __pyx_L3_error)
    } else {
      __pyx_v_N = ((int)0);
    }
    if (values[2]) {
      __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1529, __pyx_L3_error)
    } else {
      __pyx_v_x0 = __pyx_k__9;
    }
    if (values[3]) {
      __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1529, __pyx_L3_error)
    } else {
      __pyx_v_x1 = __pyx_k__10;
    }
    if (values[4]) {
      __pyx_v_maxzeros = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_maxzeros == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1529, __pyx_L3_error)
    } else {
      __pyx_v_maxzeros = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zeros", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1529, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.zeros", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_108zeros(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_h, __pyx_v_N, __pyx_v_x0, __pyx_v_x1, __pyx_v_maxzeros);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_108zeros(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_h, int __pyx_v_N, double __pyx_v_x0, double __pyx_v_x1, int __pyx_v_maxzeros) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_zeros __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zeros", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 5;
  __pyx_t_2.h = __pyx_v_h;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_2.x0 = __pyx_v_x0;
  __pyx_t_2.x1 = __pyx_v_x1;
  __pyx_t_2.maxzeros = __pyx_v_maxzeros;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core_BpfInterface->zeros(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.zeros", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1560
 *         return bpf_zero_crossings(self, h=h, N=N, x0=x0, x1=x1, maxzeros=maxzeros)
 * 
 *     def max(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing `max(self, b)`
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_111max(PyObject *__pyx_v_self, PyObject *__pyx_v_b); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_110max[] = "BpfInterface.max(self, b)\n\n        Returns a bpf representing `max(self, b)`\n\n        Args:\n            b (float | BpfInterface): a const float or a bpf\n\n        Returns:\n            (Max) A Max bpf representing `max(self, b)`, which can be\n            evaluated at any x coord\n        \n        ## Example\n        \n        ```python\n        >>> from bpf4 import *\n        >>> a = linear(0, 0, 1, 10)\n        >>> b = a.max(4)\n        >>> b(0), b(0.5), b(1)\n        (4.0, 5.0, 10.0)\n        >>> b.plot()\n        ```\n        ![](assets/maxconst.png)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_111max = {"max", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_111max, METH_O, __pyx_doc_4bpf4_4core_12BpfInterface_110max};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_111max(PyObject *__pyx_v_self, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("max (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_110max(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_110max(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("max", 0);

  /* "bpf4/core.pyx":1584
 *         """
 * 
 *         if isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             return Max(self, b)
 *         return _BpfMaxConst(self, b, self.bounds())
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":1585
 * 
 *         if isinstance(b, BpfInterface):
 *             return Max(self, b)             # <<<<<<<<<<<<<<
 *         return _BpfMaxConst(self, b, self.bounds())
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_b);
    __Pyx_GIVEREF(__pyx_v_b);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_b);
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Max), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":1584
 *         """
 * 
 *         if isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             return Max(self, b)
 *         return _BpfMaxConst(self, b, self.bounds())
 */
  }

  /* "bpf4/core.pyx":1586
 *         if isinstance(b, BpfInterface):
 *             return Max(self, b)
 *         return _BpfMaxConst(self, b, self.bounds())             # <<<<<<<<<<<<<<
 * 
 *     def min(self, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bounds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_b);
  __Pyx_GIVEREF(__pyx_v_b);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_b);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfMaxConst), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1560
 *         return bpf_zero_crossings(self, h=h, N=N, x0=x0, x1=x1, maxzeros=maxzeros)
 * 
 *     def max(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing `max(self, b)`
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1588
 *         return _BpfMaxConst(self, b, self.bounds())
 * 
 *     def min(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing `min(self, b)`
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_113min(PyObject *__pyx_v_self, PyObject *__pyx_v_b); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_112min[] = "BpfInterface.min(self, b)\n\n        Returns a bpf representing `min(self, b)`\n\n        Args:\n            b (float | BpfInterface): a const float or a bpf\n\n        Returns:\n            (Min) A Min bpf representing `min(self, b)`, which can be\n            evaluated at any x coord\n        \n        ## Example\n        \n        ```python\n        >>> from bpf4 import *\n        >>> a = linear(0, 0, 1, 10)\n        >>> b = a.min(4)\n        >>> b(0), b(0.5), b(1)\n        (0, 4.0, 5.0)\n        >>> b.plot()\n        ```\n        ![](assets/minconst.png)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_113min = {"min", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_113min, METH_O, __pyx_doc_4bpf4_4core_12BpfInterface_112min};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_113min(PyObject *__pyx_v_self, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("min (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_112min(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_112min(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("min", 0);

  /* "bpf4/core.pyx":1611
 *         ![](assets/minconst.png)
 *         """
 *         if isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             return Min(self, b)
 *         return _BpfMinConst(self, b, self.bounds())
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":1612
 *         """
 *         if isinstance(b, BpfInterface):
 *             return Min(self, b)             # <<<<<<<<<<<<<<
 *         return _BpfMinConst(self, b, self.bounds())
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_b);
    __Pyx_GIVEREF(__pyx_v_b);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_b);
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Min), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":1611
 *         ![](assets/minconst.png)
 *         """
 *         if isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             return Min(self, b)
 *         return _BpfMinConst(self, b, self.bounds())
 */
  }

  /* "bpf4/core.pyx":1613
 *         if isinstance(b, BpfInterface):
 *             return Min(self, b)
 *         return _BpfMinConst(self, b, self.bounds())             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bounds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_b);
  __Pyx_GIVEREF(__pyx_v_b);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_b);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfMinConst), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1588
 *         return _BpfMaxConst(self, b, self.bounds())
 * 
 *     def min(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing `min(self, b)`
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1615
 *         return _BpfMinConst(self, b, self.bounds())
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), self.__getstate__()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_115__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_114__reduce__[] = "BpfInterface.__reduce__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_115__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_115__reduce__, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_114__reduce__};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_115__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_114__reduce__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_114__reduce__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "bpf4/core.pyx":1616
 * 
 *     def __reduce__(self):
 *         return type(self), self.__getstate__()             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double other) nogil:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1615
 *         return _BpfMinConst(self, b, self.bounds())
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), self.__getstate__()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1618
 *         return type(self), self.__getstate__()
 * 
 *     cdef double __ccall__(self, double other) nogil:             # <<<<<<<<<<<<<<
 *         return 0.0
 * 
 */

static double __pyx_f_4bpf4_4core_12BpfInterface___ccall__(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, CYTHON_UNUSED double __pyx_v_other) {
  double __pyx_r;

  /* "bpf4/core.pyx":1619
 * 
 *     cdef double __ccall__(self, double other) nogil:
 *         return 0.0             # <<<<<<<<<<<<<<
 * 
 *     def __call__(BpfInterface self, double x):
 */
  __pyx_r = 0.0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1618
 *         return type(self), self.__getstate__()
 * 
 *     cdef double __ccall__(self, double other) nogil:             # <<<<<<<<<<<<<<
 *         return 0.0
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":1621
 *         return 0.0
 * 
 *     def __call__(BpfInterface self, double x):             # <<<<<<<<<<<<<<
 *         """
 *         BpfInterface.__call__(self, double x)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_117__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_116__call__[] = "\n        BpfInterface.__call__(self, double x)\n\n        Args:\n            x (float): evaluate this bpf at the given x coord\n\n        Returns:\n            (float) The value of this bpf at x\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_12BpfInterface_116__call__;
#endif
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_117__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 1621, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1621, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1621, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_116__call__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_116__call__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "bpf4/core.pyx":1631
 *             (float) The value of this bpf at x
 *         """
 *         return self.__ccall__(x)             # <<<<<<<<<<<<<<
 * 
 *     def keep_slope(self, double epsilon=DEFAULT_EPSILON):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->__pyx___ccall__(__pyx_v_self, __pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1621
 *         return 0.0
 * 
 *     def __call__(BpfInterface self, double x):             # <<<<<<<<<<<<<<
 *         """
 *         BpfInterface.__call__(self, double x)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1633
 *         return self.__ccall__(x)
 * 
 *     def keep_slope(self, double epsilon=DEFAULT_EPSILON):             # <<<<<<<<<<<<<<
 *         """
 *         A view of this bpf where the slope is continued outside its bounds
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_119keep_slope(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_118keep_slope[] = "BpfInterface.keep_slope(self, double epsilon=0.0001)\n\n        A view of this bpf where the slope is continued outside its bounds\n\n\n        Return a new bpf which is a copy of this bpf when inside\n        bounds() but outside bounds() it behaves as a linear bpf\n        with a slope equal to the slope of this bpf at its extremes\n        \n        Args:\n            epsilon (float): an epsilon value to use when deriving the\n                this bpf to calculate its slope\n\n        Returns:\n            (BpfInterface) A view of this bpf which keeps its slope outside\n            its bounds (instead of just returning the last defined value)\n\n        Example\n        -------\n\n        ```python\n\n        a = expon(1, 1, 2, 2, exp=2)\n        b = a.keep_slope()\n        b[0:3].plot(show=False, color=\"grey\")\n        a.plot(color=\"black\", linewidth=3)\n        ```\n        ![](assets/keepslope1.png)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_119keep_slope = {"keep_slope", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_119keep_slope, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_118keep_slope};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_119keep_slope(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_epsilon;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("keep_slope (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_epsilon,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_epsilon);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "keep_slope") < 0)) __PYX_ERR(0, 1633, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_epsilon = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_epsilon == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1633, __pyx_L3_error)
    } else {
      __pyx_v_epsilon = ((double)0.0001);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("keep_slope", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1633, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.keep_slope", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_118keep_slope(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_epsilon);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_118keep_slope(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_epsilon) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("keep_slope", 0);

  /* "bpf4/core.pyx":1662
 *         ![](assets/keepslope1.png)
 *         """
 *         return _BpfKeepSlope(self, epsilon)             # <<<<<<<<<<<<<<
 * 
 *     def outbound(self, double y0, double y1):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_epsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfKeepSlope), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1633
 *         return self.__ccall__(x)
 * 
 *     def keep_slope(self, double epsilon=DEFAULT_EPSILON):             # <<<<<<<<<<<<<<
 *         """
 *         A view of this bpf where the slope is continued outside its bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.keep_slope", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1664
 *         return _BpfKeepSlope(self, epsilon)
 * 
 *     def outbound(self, double y0, double y1):             # <<<<<<<<<<<<<<
 *         """
 *         Return a new Bpf with the given values outside the bounds
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_121outbound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_120outbound[] = "BpfInterface.outbound(self, double y0, double y1)\n\n        Return a new Bpf with the given values outside the bounds\n\n        ## Examples\n        \n        ```python\n\n        >>> from bpf4 import *\n        >>> a = linear(0, 1, 1, 10).outbound(-1, 0)\n        >>> a(-0.5)\n        -1\n        >>> a(1.1)\n        0\n        >>> a(0)\n        1\n        >>> a(1)\n        10\n\n        # fallback to another curve outside self\n        >>> a = linear(0, 1, 1, 10).outbound(0, 0) + expon(-1, 2, 4, 10, exp=2)\n        >>> a.plot()\n        ```\n        ![](assets/outbound1.png)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_121outbound = {"outbound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_121outbound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_120outbound};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_121outbound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_y0;
  double __pyx_v_y1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outbound (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y0,&__pyx_n_s_y1,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("outbound", 1, 2, 2, 1); __PYX_ERR(0, 1664, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outbound") < 0)) __PYX_ERR(0, 1664, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_y0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_y0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1664, __pyx_L3_error)
    __pyx_v_y1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_y1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1664, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("outbound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1664, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.outbound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_120outbound(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_y0, __pyx_v_y1);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_120outbound(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_y0, double __pyx_v_y1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core__BpfCrop_new __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("outbound", 0);

  /* "bpf4/core.pyx":1689
 *         ![](assets/outbound1.png)
 *         """
 *         return _BpfCrop_new(self, self._x0, self._x1, OUTBOUND_SET, y0, y1)             # <<<<<<<<<<<<<<
 * 
 *     def apply(self, func):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.outbound0 = __pyx_v_y0;
  __pyx_t_2.outbound1 = __pyx_v_y1;
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfCrop_new(__pyx_v_self, __pyx_v_self->_x0, __pyx_v_self->_x1, 2, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1664
 *         return _BpfKeepSlope(self, epsilon)
 * 
 *     def outbound(self, double y0, double y1):             # <<<<<<<<<<<<<<
 *         """
 *         Return a new Bpf with the given values outside the bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.outbound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1691
 *         return _BpfCrop_new(self, self._x0, self._x1, OUTBOUND_SET, y0, y1)
 * 
 *     def apply(self, func):             # <<<<<<<<<<<<<<
 *         """
 *         Create a bpf where `func` is applied to the result of this pdf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_123apply(PyObject *__pyx_v_self, PyObject *__pyx_v_func); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_122apply[] = "BpfInterface.apply(self, func)\n\n        Create a bpf where `func` is applied to the result of this pdf\n        \n        Args:\n            func (callable): a function to apply to the result of this bpf\n\n        Returns:\n            (BpfInterface) A bpf representing `func(self(x))` \n\n        **NB**: `a.apply(b)` is the same as `a | b`\n        \n        ## Example\n        \n        ```python\n\n        >>> from bpf4 import *\n        >>> from math import *\n        >>> a = linear(0, 0, 1, 10)\n        >>> def func(x):\n        ...     return sin(x) + 1\n        >>> b = a.apply(func)\n        >>> b(1)\n        0.4559788891106302\n        >>> sin(a(1)) + 1\n        0.4559788891106302\n        \n        ```\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_123apply = {"apply", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_123apply, METH_O, __pyx_doc_4bpf4_4core_12BpfInterface_122apply};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_123apply(PyObject *__pyx_v_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("apply (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_122apply(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), ((PyObject *)__pyx_v_func));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_122apply(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("apply", 0);

  /* "bpf4/core.pyx":1721
 * 
 *         """
 *         return _BpfCompose_new(self, _FunctionWrap(func))             # <<<<<<<<<<<<<<
 * 
 *     def preapply(self, func):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FunctionWrap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_func);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 1721, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_4bpf4_4core__BpfCompose_new(__pyx_v_self, ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1691
 *         return _BpfCrop_new(self, self._x0, self._x1, OUTBOUND_SET, y0, y1)
 * 
 *     def apply(self, func):             # <<<<<<<<<<<<<<
 *         """
 *         Create a bpf where `func` is applied to the result of this pdf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1723
 *         return _BpfCompose_new(self, _FunctionWrap(func))
 * 
 *     def preapply(self, func):             # <<<<<<<<<<<<<<
 *         """
 *         Create a bpf where `func` is applied to the argument before it is passed
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_125preapply(PyObject *__pyx_v_self, PyObject *__pyx_v_func); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_124preapply[] = "BpfInterface.preapply(self, func)\n\n        Create a bpf where `func` is applied to the argument before it is passed\n\n        This is equivalent to `func(x) | self`\n        \n        Args:\n            func (callable): a function `func(x: float) -> float` which is applied to\n                the argument before passing it to this bpf\n\n        Returns:\n            (BpfInterface) A bpf following the pattern `lambda x: bpf(func(x))`\n\n        ## Example\n        \n        ```python\n\n        >>> bpf = Linear((0, 1, 2), (0, 10, 20))\n        >>> bpf(0.5)\n        5\n\n        >>> shifted_bpf = bpf.preapply(lambda x: x + 1)\n        >>> shifted_bpf(0.5)\n        15\n        ```\n\n        **NB**: `bpf1.preapply(bpf2)` is the same as `bpf2 | bpf1`\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_125preapply = {"preapply", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_125preapply, METH_O, __pyx_doc_4bpf4_4core_12BpfInterface_124preapply};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_125preapply(PyObject *__pyx_v_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("preapply (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_124preapply(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), ((PyObject *)__pyx_v_func));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_124preapply(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("preapply", 0);

  /* "bpf4/core.pyx":1751
 *         **NB**: `bpf1.preapply(bpf2)` is the same as `bpf2 | bpf1`
 *         """
 *         return _BpfCompose_new(_FunctionWrap(func), self)             # <<<<<<<<<<<<<<
 * 
 *     def periodic(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FunctionWrap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_func);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 1751, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_4bpf4_4core__BpfCompose_new(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1), __pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1723
 *         return _BpfCompose_new(self, _FunctionWrap(func))
 * 
 *     def preapply(self, func):             # <<<<<<<<<<<<<<
 *         """
 *         Create a bpf where `func` is applied to the argument before it is passed
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.preapply", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1753
 *         return _BpfCompose_new(_FunctionWrap(func), self)
 * 
 *     def periodic(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new bpf which replicates this in a periodic way
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_127periodic(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_126periodic[] = "BpfInterface.periodic(self)\n\n        Create a new bpf which replicates this in a periodic way\n\n        Returns:\n            (BpfInterface) A periodic view of this bpf\n\n        The new bpf is a copy of this bpf when inside its bounds \n        and outside it, it replicates it in a periodic way, with no bounds.\n\n        ## Example\n            \n        ```python\n\n        >>> from bpf4 import *\n        >>> a = core.Linear((0, 1), (-1, 1)).periodic()\n        >>> a\n        _BpfPeriodic[-inf:inf]\n        >>> a.plot()\n        ```\n        ![](assets/periodic1.png)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_127periodic = {"periodic", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_127periodic, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_126periodic};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_127periodic(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_126periodic(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_126periodic(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("periodic", 0);

  /* "bpf4/core.pyx":1775
 *         ![](assets/periodic1.png)
 *         """
 *         return _BpfPeriodic(self)             # <<<<<<<<<<<<<<
 * 
 *     def stretched(self, double rx, double fixpoint=0.):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfPeriodic), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1753
 *         return _BpfCompose_new(_FunctionWrap(func), self)
 * 
 *     def periodic(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new bpf which replicates this in a periodic way
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1777
 *         return _BpfPeriodic(self)
 * 
 *     def stretched(self, double rx, double fixpoint=0.):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a view of this bpf stretched over the x axis.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_129stretched(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_128stretched[] = "BpfInterface.stretched(self, double rx, double fixpoint=0.)\n\n        Returns a view of this bpf stretched over the x axis. \n\n        **NB**: to stretch over the y-axis, just multiply this bpf\n        \n        !!! info \"See Also\"\n\n            [fit_between()](#fit_between)\n\n        Args:\n            rx (float): the stretch factor\n            fixpoint (float): the point to use as reference\n\n        Returns:\n            (BpfInterface) A projection of this bpf stretched/compressed by\n            by the given factor\n\n        ## Example\n\n        Stretch the shape of the bpf, but preserve the start position\n        \n        ```python\n            \n        >>> a = linear(1, 1, 2, 2)\n        >>> b = a.stretched(4, fixpoint=a.x0)\n        >>> b.bounds()\n        (1, 9)\n        >>> a.plot(show=False); b.plot()\n\n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_129stretched = {"stretched", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_129stretched, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_128stretched};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_129stretched(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_rx;
  double __pyx_v_fixpoint;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stretched (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rx,&__pyx_n_s_fixpoint,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fixpoint);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stretched") < 0)) __PYX_ERR(0, 1777, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_rx = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_rx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1777, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_fixpoint = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fixpoint == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1777, __pyx_L3_error)
    } else {
      __pyx_v_fixpoint = ((double)0.);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stretched", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1777, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.stretched", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_128stretched(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_rx, __pyx_v_fixpoint);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_128stretched(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_rx, double __pyx_v_fixpoint) {
  double __pyx_v_qrx;
  double __pyx_v_x0;
  double __pyx_v_x1;
  double __pyx_v_p0;
  double __pyx_v_p1;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stretched", 0);

  /* "bpf4/core.pyx":1809
 *         ```
 *         """
 *         if rx == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("the stretch factor cannot be 0")
 * 
 */
  __pyx_t_1 = ((__pyx_v_rx == 0.0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "bpf4/core.pyx":1810
 *         """
 *         if rx == 0:
 *             raise ValueError("the stretch factor cannot be 0")             # <<<<<<<<<<<<<<
 * 
 *         if self._x0 == INF or self._x0 == INFNEG or self._x1 == INF or self._x1 == INFNEG:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1810, __pyx_L1_error)

    /* "bpf4/core.pyx":1809
 *         ```
 *         """
 *         if rx == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("the stretch factor cannot be 0")
 * 
 */
  }

  /* "bpf4/core.pyx":1812
 *             raise ValueError("the stretch factor cannot be 0")
 * 
 *         if self._x0 == INF or self._x0 == INFNEG or self._x1 == INF or self._x1 == INFNEG:             # <<<<<<<<<<<<<<
 *             qrx = 1/rx
 *             return _BpfProjection(rx=qrx, dx=0, offset=fixpoint)
 */
  __pyx_t_3 = ((__pyx_v_self->_x0 == Py_HUGE_VAL) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_self->_x0 == (-Py_HUGE_VAL)) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_self->_x1 == Py_HUGE_VAL) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_self->_x1 == (-Py_HUGE_VAL)) != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":1813
 * 
 *         if self._x0 == INF or self._x0 == INFNEG or self._x1 == INF or self._x1 == INFNEG:
 *             qrx = 1/rx             # <<<<<<<<<<<<<<
 *             return _BpfProjection(rx=qrx, dx=0, offset=fixpoint)
 * 
 */
    if (unlikely(__pyx_v_rx == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 1813, __pyx_L1_error)
    }
    __pyx_v_qrx = (1.0 / __pyx_v_rx);

    /* "bpf4/core.pyx":1814
 *         if self._x0 == INF or self._x0 == INFNEG or self._x1 == INF or self._x1 == INFNEG:
 *             qrx = 1/rx
 *             return _BpfProjection(rx=qrx, dx=0, offset=fixpoint)             # <<<<<<<<<<<<<<
 * 
 *         cdef double x0 = self._x0
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1814, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_qrx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1814, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rx, __pyx_t_4) < 0) __PYX_ERR(0, 1814, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dx, __pyx_int_0) < 0) __PYX_ERR(0, 1814, __pyx_L1_error)
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_fixpoint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1814, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_offset, __pyx_t_4) < 0) __PYX_ERR(0, 1814, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfProjection), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1814, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":1812
 *             raise ValueError("the stretch factor cannot be 0")
 * 
 *         if self._x0 == INF or self._x0 == INFNEG or self._x1 == INF or self._x1 == INFNEG:             # <<<<<<<<<<<<<<
 *             qrx = 1/rx
 *             return _BpfProjection(rx=qrx, dx=0, offset=fixpoint)
 */
  }

  /* "bpf4/core.pyx":1816
 *             return _BpfProjection(rx=qrx, dx=0, offset=fixpoint)
 * 
 *         cdef double x0 = self._x0             # <<<<<<<<<<<<<<
 *         cdef double x1 = self._x1
 *         cdef double p0 = (x0 - fixpoint)*rx + fixpoint
 */
  __pyx_t_5 = __pyx_v_self->_x0;
  __pyx_v_x0 = __pyx_t_5;

  /* "bpf4/core.pyx":1817
 * 
 *         cdef double x0 = self._x0
 *         cdef double x1 = self._x1             # <<<<<<<<<<<<<<
 *         cdef double p0 = (x0 - fixpoint)*rx + fixpoint
 *         cdef double p1 = (x1 - x0) * rx + p0
 */
  __pyx_t_5 = __pyx_v_self->_x1;
  __pyx_v_x1 = __pyx_t_5;

  /* "bpf4/core.pyx":1818
 *         cdef double x0 = self._x0
 *         cdef double x1 = self._x1
 *         cdef double p0 = (x0 - fixpoint)*rx + fixpoint             # <<<<<<<<<<<<<<
 *         cdef double p1 = (x1 - x0) * rx + p0
 *         return self.fit_between(p0, p1)
 */
  __pyx_v_p0 = (((__pyx_v_x0 - __pyx_v_fixpoint) * __pyx_v_rx) + __pyx_v_fixpoint);

  /* "bpf4/core.pyx":1819
 *         cdef double x1 = self._x1
 *         cdef double p0 = (x0 - fixpoint)*rx + fixpoint
 *         cdef double p1 = (x1 - x0) * rx + p0             # <<<<<<<<<<<<<<
 *         return self.fit_between(p0, p1)
 * 
 */
  __pyx_v_p1 = (((__pyx_v_x1 - __pyx_v_x0) * __pyx_v_rx) + __pyx_v_p0);

  /* "bpf4/core.pyx":1820
 *         cdef double p0 = (x0 - fixpoint)*rx + fixpoint
 *         cdef double p1 = (x1 - x0) * rx + p0
 *         return self.fit_between(p0, p1)             # <<<<<<<<<<<<<<
 * 
 *     cpdef BpfInterface fit_between(self, double x0, double x1):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->fit_between(__pyx_v_self, __pyx_v_p0, __pyx_v_p1, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1777
 *         return _BpfPeriodic(self)
 * 
 *     def stretched(self, double rx, double fixpoint=0.):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a view of this bpf stretched over the x axis.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.stretched", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1822
 *         return self.fit_between(p0, p1)
 * 
 *     cpdef BpfInterface fit_between(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a view of this bpf fitted within the interval `x0:x1`
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_131fit_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_fit_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch) {
  double __pyx_v_rx;
  double __pyx_v_dx;
  double __pyx_v_offset;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  double __pyx_t_11;
  double __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fit_between", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fit_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_131fit_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1822, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1822, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1822, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 1822, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1852
 *         """
 *         cdef double rx
 *         if self._x0 == INF or self._x0 == INFNEG or self._x1 == INF or self._x1 == INFNEG:             # <<<<<<<<<<<<<<
 *             raise ValueError("This bpf is unbounded, cannot be fitted."
 *                              "Use thisbpf[x0:x1].fit_between(...)")
 */
  __pyx_t_10 = ((__pyx_v_self->_x0 == Py_HUGE_VAL) != 0);
  if (!__pyx_t_10) {
  } else {
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_10 = ((__pyx_v_self->_x0 == (-Py_HUGE_VAL)) != 0);
  if (!__pyx_t_10) {
  } else {
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_10 = ((__pyx_v_self->_x1 == Py_HUGE_VAL) != 0);
  if (!__pyx_t_10) {
  } else {
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_10 = ((__pyx_v_self->_x1 == (-Py_HUGE_VAL)) != 0);
  __pyx_t_9 = __pyx_t_10;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_9)) {

    /* "bpf4/core.pyx":1853
 *         cdef double rx
 *         if self._x0 == INF or self._x0 == INFNEG or self._x1 == INF or self._x1 == INFNEG:
 *             raise ValueError("This bpf is unbounded, cannot be fitted."             # <<<<<<<<<<<<<<
 *                              "Use thisbpf[x0:x1].fit_between(...)")
 *         rx = (self._x1 - self._x0) / (x1 - x0)
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1853, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1853, __pyx_L1_error)

    /* "bpf4/core.pyx":1852
 *         """
 *         cdef double rx
 *         if self._x0 == INF or self._x0 == INFNEG or self._x1 == INF or self._x1 == INFNEG:             # <<<<<<<<<<<<<<
 *             raise ValueError("This bpf is unbounded, cannot be fitted."
 *                              "Use thisbpf[x0:x1].fit_between(...)")
 */
  }

  /* "bpf4/core.pyx":1855
 *             raise ValueError("This bpf is unbounded, cannot be fitted."
 *                              "Use thisbpf[x0:x1].fit_between(...)")
 *         rx = (self._x1 - self._x0) / (x1 - x0)             # <<<<<<<<<<<<<<
 *         dx = self._x0
 *         offset = x0
 */
  __pyx_t_11 = (__pyx_v_self->_x1 - __pyx_v_self->_x0);
  __pyx_t_12 = (__pyx_v_x1 - __pyx_v_x0);
  if (unlikely(__pyx_t_12 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1855, __pyx_L1_error)
  }
  __pyx_v_rx = (__pyx_t_11 / __pyx_t_12);

  /* "bpf4/core.pyx":1856
 *                              "Use thisbpf[x0:x1].fit_between(...)")
 *         rx = (self._x1 - self._x0) / (x1 - x0)
 *         dx = self._x0             # <<<<<<<<<<<<<<
 *         offset = x0
 *         return _BpfProjection(self, rx=rx, dx=dx, offset=offset)
 */
  __pyx_t_12 = __pyx_v_self->_x0;
  __pyx_v_dx = __pyx_t_12;

  /* "bpf4/core.pyx":1857
 *         rx = (self._x1 - self._x0) / (x1 - x0)
 *         dx = self._x0
 *         offset = x0             # <<<<<<<<<<<<<<
 *         return _BpfProjection(self, rx=rx, dx=dx, offset=offset)
 * 
 */
  __pyx_v_offset = __pyx_v_x0;

  /* "bpf4/core.pyx":1858
 *         dx = self._x0
 *         offset = x0
 *         return _BpfProjection(self, rx=rx, dx=dx, offset=offset)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_rx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rx, __pyx_t_5) < 0) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dx, __pyx_t_5) < 0) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_offset, __pyx_t_5) < 0) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfProjection), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1822
 *         return self.fit_between(p0, p1)
 * 
 *     cpdef BpfInterface fit_between(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a view of this bpf fitted within the interval `x0:x1`
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.fit_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_131fit_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_130fit_between[] = "BpfInterface.fit_between(self, double x0, double x1) -> BpfInterface\n\n        Returns a view of this bpf fitted within the interval `x0:x1`\n\n        This operation only makes sense if the bpf is bounded\n        (none of its bounds is `inf`)\n\n        Args:\n            x0: the lower bound to fit this bpf\n            x1: the upper bound to fit this bpf\n\n        Returns:\n            (BpfInterface) The projected bpf\n\n        ## Example\n        \n        ```python\n\n        >>> from bpf4 import *\n        >>> a = linear(1, 1, 2, 5)\n        >>> a.bounds()\n        (1, 5)\n        >>> b = a.fit_between(0, 10)\n        >>> b.bounds()\n        0, 10\n        >>> b(10)\n        5\n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_131fit_between = {"fit_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_131fit_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_130fit_between};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_131fit_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fit_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fit_between", 1, 2, 2, 1); __PYX_ERR(0, 1822, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fit_between") < 0)) __PYX_ERR(0, 1822, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1822, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1822, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fit_between", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1822, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.fit_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_130fit_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_130fit_between(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fit_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_fit_between(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.fit_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1861
 * 
 * 
 *     cpdef BpfInterface shifted(self, dx):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a view of this bpf shifted by `dx` over the x-axes
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_133shifted(PyObject *__pyx_v_self, PyObject *__pyx_v_dx); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface_shifted(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_dx, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shifted", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shifted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1861, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_133shifted)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_dx) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dx);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1861, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 1861, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1877
 *         ```
 *         """
 *         return _BpfProjection(self, rx=1, dx=-dx)             # <<<<<<<<<<<<<<
 * 
 *     def inverted(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rx, __pyx_int_1) < 0) __PYX_ERR(0, 1877, __pyx_L1_error)
  __pyx_t_3 = PyNumber_Negative(__pyx_v_dx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dx, __pyx_t_3) < 0) __PYX_ERR(0, 1877, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfProjection), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1877, __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;
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1861
 * 
 * 
 *     cpdef BpfInterface shifted(self, dx):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a view of this bpf shifted by `dx` over the x-axes
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.shifted", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_133shifted(PyObject *__pyx_v_self, PyObject *__pyx_v_dx); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_132shifted[] = "BpfInterface.shifted(self, dx) -> BpfInterface\n\n        Returns a view of this bpf shifted by `dx` over the x-axes\n\n        This is the same as [.shift](#shift), but a new bpf is returned\n\n        ## Example\n        \n        ```python\n\n        >>> from bpf4 import *\n        >>> a = linear(0, 1, 1, 5)\n        >>> b = a.shifted(2)\n        >>> b(3) == a(1)\n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_133shifted = {"shifted", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_133shifted, METH_O, __pyx_doc_4bpf4_4core_12BpfInterface_132shifted};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_133shifted(PyObject *__pyx_v_self, PyObject *__pyx_v_dx) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shifted (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_132shifted(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), ((PyObject *)__pyx_v_dx));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_132shifted(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_dx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shifted", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface_shifted(__pyx_v_self, __pyx_v_dx, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.shifted", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1879
 *         return _BpfProjection(self, rx=1, dx=-dx)
 * 
 *     def inverted(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view on this bpf with the coords inverted
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_135inverted(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_134inverted[] = "BpfInterface.inverted(self)\n\n        Return a view on this bpf with the coords inverted\n\n        Returns:\n            (BpfInterface) a view on this bpf with the coords inverted\n\n        In an inverted function the coordinates are swaped: the inverted version of a \n        bpf indicates which *x* corresponds to a given *y*\n        \n        Returns None if the function is not invertible. For a function to be invertible, \n        it must be strictly increasing or decreasing, with no local maxima or minima.\n        \n        ```\n        f.inverted()(f(x)) = x\n        ```\n        \n        So if `y(1) == 2`, then `y.inverted()(2) == 1`\n\n        ![](assets/inverted.png)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_135inverted = {"inverted", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_135inverted, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_134inverted};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_135inverted(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inverted (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_134inverted(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_134inverted(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("inverted", 0);

  /* "bpf4/core.pyx":1900
 *         ![](assets/inverted.png)
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return _BpfInverted(self)
 *         except ValueError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "bpf4/core.pyx":1901
 *         """
 *         try:
 *             return _BpfInverted(self)             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             return None
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfInverted), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1901, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "bpf4/core.pyx":1900
 *         ![](assets/inverted.png)
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return _BpfInverted(self)
 *         except ValueError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "bpf4/core.pyx":1902
 *         try:
 *             return _BpfInverted(self)
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("bpf4.core.BpfInterface.inverted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1902, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "bpf4/core.pyx":1903
 *             return _BpfInverted(self)
 *         except ValueError:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     cpdef BpfInterface _slice(self, double x0, double x1):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "bpf4/core.pyx":1900
 *         ![](assets/inverted.png)
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return _BpfInverted(self)
 *         except ValueError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":1879
 *         return _BpfProjection(self, rx=1, dx=-dx)
 * 
 *     def inverted(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view on this bpf with the coords inverted
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.inverted", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1905
 *             return None
 * 
 *     cpdef BpfInterface _slice(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         return _BpfCrop_new(self, x0, x1, OUTBOUND_DEFAULT, 0, 0)
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_137_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_12BpfInterface__slice(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  struct __pyx_opt_args_4bpf4_4core__BpfCrop_new __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_slice", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_slice); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1905, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_12BpfInterface_137_slice)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1905, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1905, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1905, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1905, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1905, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1905, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 1905, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":1906
 * 
 *     cpdef BpfInterface _slice(self, double x0, double x1):
 *         return _BpfCrop_new(self, x0, x1, OUTBOUND_DEFAULT, 0, 0)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, slice):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_9.__pyx_n = 2;
  __pyx_t_9.outbound0 = 0.0;
  __pyx_t_9.outbound1 = 0.0;
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfCrop_new(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, -1, 0, &__pyx_t_9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1905
 *             return None
 * 
 *     cpdef BpfInterface _slice(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         return _BpfCrop_new(self, x0, x1, OUTBOUND_DEFAULT, 0, 0)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bpf4.core.BpfInterface._slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_137_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_136_slice[] = "BpfInterface._slice(self, double x0, double x1) -> BpfInterface";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_137_slice = {"_slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_137_slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_136_slice};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_137_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_slice", 1, 2, 2, 1); __PYX_ERR(0, 1905, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_slice") < 0)) __PYX_ERR(0, 1905, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1905, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1905, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_slice", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1905, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface._slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_136_slice(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_136_slice(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_slice", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_12BpfInterface__slice(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfInterface._slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1908
 *         return _BpfCrop_new(self, x0, x1, OUTBOUND_DEFAULT, 0, 0)
 * 
 *     def __getitem__(self, slice):             # <<<<<<<<<<<<<<
 *         cdef double x0, x1
 *         cdef BpfInterface out
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_139__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_slice); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_139__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_slice) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_138__getitem__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), ((PyObject *)__pyx_v_slice));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_138__getitem__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_slice) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled_between __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "bpf4/core.pyx":1911
 *         cdef double x0, x1
 *         cdef BpfInterface out
 *         x0 = self._x0             # <<<<<<<<<<<<<<
 *         x1 = self._x1
 *         try:
 */
  __pyx_t_1 = __pyx_v_self->_x0;
  __pyx_v_x0 = __pyx_t_1;

  /* "bpf4/core.pyx":1912
 *         cdef BpfInterface out
 *         x0 = self._x0
 *         x1 = self._x1             # <<<<<<<<<<<<<<
 *         try:
 *             if slice.start is not None:
 */
  __pyx_t_1 = __pyx_v_self->_x1;
  __pyx_v_x1 = __pyx_t_1;

  /* "bpf4/core.pyx":1913
 *         x0 = self._x0
 *         x1 = self._x1
 *         try:             # <<<<<<<<<<<<<<
 *             if slice.start is not None:
 *                 x0 = slice.start
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "bpf4/core.pyx":1914
 *         x1 = self._x1
 *         try:
 *             if slice.start is not None:             # <<<<<<<<<<<<<<
 *                 x0 = slice.start
 *             if slice.stop is not None:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_slice, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1914, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = (__pyx_t_5 != Py_None);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = (__pyx_t_6 != 0);
      if (__pyx_t_7) {

        /* "bpf4/core.pyx":1915
 *         try:
 *             if slice.start is not None:
 *                 x0 = slice.start             # <<<<<<<<<<<<<<
 *             if slice.stop is not None:
 *                 x1 = slice.stop
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_slice, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1915, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1915, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_v_x0 = __pyx_t_1;

        /* "bpf4/core.pyx":1914
 *         x1 = self._x1
 *         try:
 *             if slice.start is not None:             # <<<<<<<<<<<<<<
 *                 x0 = slice.start
 *             if slice.stop is not None:
 */
      }

      /* "bpf4/core.pyx":1916
 *             if slice.start is not None:
 *                 x0 = slice.start
 *             if slice.stop is not None:             # <<<<<<<<<<<<<<
 *                 x1 = slice.stop
 *             if slice.step is not None:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_slice, __pyx_n_s_stop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1916, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = (__pyx_t_5 != Py_None);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = (__pyx_t_7 != 0);
      if (__pyx_t_6) {

        /* "bpf4/core.pyx":1917
 *                 x0 = slice.start
 *             if slice.stop is not None:
 *                 x1 = slice.stop             # <<<<<<<<<<<<<<
 *             if slice.step is not None:
 *                 return self.sampled_between(x0, x1, slice.step, 'linear')
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_slice, __pyx_n_s_stop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1917, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1917, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_v_x1 = __pyx_t_1;

        /* "bpf4/core.pyx":1916
 *             if slice.start is not None:
 *                 x0 = slice.start
 *             if slice.stop is not None:             # <<<<<<<<<<<<<<
 *                 x1 = slice.stop
 *             if slice.step is not None:
 */
      }

      /* "bpf4/core.pyx":1918
 *             if slice.stop is not None:
 *                 x1 = slice.stop
 *             if slice.step is not None:             # <<<<<<<<<<<<<<
 *                 return self.sampled_between(x0, x1, slice.step, 'linear')
 *             return self._slice(x0, x1)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_slice, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1918, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = (__pyx_t_5 != Py_None);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = (__pyx_t_6 != 0);
      if (__pyx_t_7) {

        /* "bpf4/core.pyx":1919
 *                 x1 = slice.stop
 *             if slice.step is not None:
 *                 return self.sampled_between(x0, x1, slice.step, 'linear')             # <<<<<<<<<<<<<<
 *             return self._slice(x0, x1)
 *         except AttributeError:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_slice, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1919, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1919, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_8.__pyx_n = 1;
        __pyx_t_8.interpolation = __pyx_n_u_linear;
        __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->sampled_between(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, __pyx_t_1, 0, &__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1919, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L7_try_return;

        /* "bpf4/core.pyx":1918
 *             if slice.stop is not None:
 *                 x1 = slice.stop
 *             if slice.step is not None:             # <<<<<<<<<<<<<<
 *                 return self.sampled_between(x0, x1, slice.step, 'linear')
 *             return self._slice(x0, x1)
 */
      }

      /* "bpf4/core.pyx":1920
 *             if slice.step is not None:
 *                 return self.sampled_between(x0, x1, slice.step, 'linear')
 *             return self._slice(x0, x1)             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             raise ValueError("BPFs accept only slices, not single items.")
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_vtab)->_slice(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1920, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L7_try_return;

      /* "bpf4/core.pyx":1913
 *         x0 = self._x0
 *         x1 = self._x1
 *         try:             # <<<<<<<<<<<<<<
 *             if slice.start is not None:
 *                 x0 = slice.start
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bpf4/core.pyx":1921
 *                 return self.sampled_between(x0, x1, slice.step, 'linear')
 *             return self._slice(x0, x1)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             raise ValueError("BPFs accept only slices, not single items.")
 * 
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("bpf4.core.BpfInterface.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(0, 1921, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GOTREF(__pyx_t_11);

      /* "bpf4/core.pyx":1922
 *             return self._slice(x0, x1)
 *         except AttributeError:
 *             raise ValueError("BPFs accept only slices, not single items.")             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1922, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_Raise(__pyx_t_12, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __PYX_ERR(0, 1922, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "bpf4/core.pyx":1913
 *         x0 = self._x0
 *         x1 = self._x1
 *         try:             # <<<<<<<<<<<<<<
 *             if slice.start is not None:
 *                 x0 = slice.start
 */
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":1908
 *         return _BpfCrop_new(self, x0, x1, OUTBOUND_DEFAULT, 0, 0)
 * 
 *     def __getitem__(self, slice):             # <<<<<<<<<<<<<<
 *         cdef double x0, x1
 *         cdef BpfInterface out
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1925
 * 
 *     @classmethod
 *     def fromseq(cls, *points, **kws):             # <<<<<<<<<<<<<<
 *         """
 *         A helper constructor, in this variant points are given as tuples or as a flat sequence.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_141fromseq(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_140fromseq[] = "BpfInterface.fromseq(type cls, *points, **kws)\n\n        A helper constructor, in this variant points are given as tuples or as a flat sequence. \n\n        ## Example\n\n        These operations result in the same bpf:\n\n        ```python\n        Linear.fromseq(x0, y0, x1, y1, x2, y2, ...)\n        Linear.fromseq((x0, y0), (x1, y1), (x2, y2), ...)\n        Linear((x0, x1, ...), (y0, y1, ...))\n        ```\n\n        Args:\n            points (ndarray | list[float]): either the interleaved x and y points, or each point as a\n                2D tuple\n            kws: any keyword will be passed to the default constructor (for \n                example, `exp` in the case of an `Expon` bpf)\n\n        Returns:\n            (BpfBase) The constructed bpf\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_141fromseq = {"fromseq", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_141fromseq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_140fromseq};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_141fromseq(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_points = 0;
  PyObject *__pyx_v_kws = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fromseq (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fromseq", 1))) return NULL;
  __pyx_v_kws = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kws)) return NULL;
  __Pyx_GOTREF(__pyx_v_kws);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_points = __pyx_args;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_140fromseq(((PyTypeObject*)__pyx_v_cls), __pyx_v_points, __pyx_v_kws);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_points);
  __Pyx_XDECREF(__pyx_v_kws);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_140fromseq(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_points, PyObject *__pyx_v_kws) {
  PyArrayObject *__pyx_v_data = 0;
  int __pyx_v_lenpoints;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fromseq", 0);

  /* "bpf4/core.pyx":1950
 *         cdef ndarray data
 *         cdef int lenpoints
 *         if isinstance(points[0], (list, tuple)):             # <<<<<<<<<<<<<<
 *             # (x0, y0), (x1, y1), ...
 *             data = numpy.asarray(points, dtype=DTYPE)
 */
  __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_points, 0);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyList_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_points, 0);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "bpf4/core.pyx":1952
 *         if isinstance(points[0], (list, tuple)):
 *             # (x0, y0), (x1, y1), ...
 *             data = numpy.asarray(points, dtype=DTYPE)             # <<<<<<<<<<<<<<
 *             return cls(data[:,0], data[:,1], **kws)
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_points);
    __Pyx_GIVEREF(__pyx_v_points);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_points);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1952, __pyx_L1_error)
    __pyx_v_data = ((PyArrayObject *)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "bpf4/core.pyx":1953
 *             # (x0, y0), (x1, y1), ...
 *             data = numpy.asarray(points, dtype=DTYPE)
 *             return cls(data[:,0], data[:,1], **kws)             # <<<<<<<<<<<<<<
 *         else:
 *             # x0, y0, x1, y1, ...
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_tuple__15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_tuple__16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
    __pyx_t_7 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_Copy(__pyx_v_kws); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":1950
 *         cdef ndarray data
 *         cdef int lenpoints
 *         if isinstance(points[0], (list, tuple)):             # <<<<<<<<<<<<<<
 *             # (x0, y0), (x1, y1), ...
 *             data = numpy.asarray(points, dtype=DTYPE)
 */
  }

  /* "bpf4/core.pyx":1956
 *         else:
 *             # x0, y0, x1, y1, ...
 *             lenpoints = len(points)             # <<<<<<<<<<<<<<
 *             if lenpoints % 2 != 0:
 *                 raise ValueError(
 */
  /*else*/ {
    __pyx_t_8 = PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1956, __pyx_L1_error)
    __pyx_v_lenpoints = __pyx_t_8;

    /* "bpf4/core.pyx":1957
 *             # x0, y0, x1, y1, ...
 *             lenpoints = len(points)
 *             if lenpoints % 2 != 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "The instantiation form x0, y0, x1, y1 should have an even number of args"
 */
    __pyx_t_3 = ((__Pyx_mod_long(__pyx_v_lenpoints, 2) != 0) != 0);
    if (unlikely(__pyx_t_3)) {

      /* "bpf4/core.pyx":1958
 *             lenpoints = len(points)
 *             if lenpoints % 2 != 0:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "The instantiation form x0, y0, x1, y1 should have an even number of args"
 *                 )
 */
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __PYX_ERR(0, 1958, __pyx_L1_error)

      /* "bpf4/core.pyx":1957
 *             # x0, y0, x1, y1, ...
 *             lenpoints = len(points)
 *             if lenpoints % 2 != 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "The instantiation form x0, y0, x1, y1 should have an even number of args"
 */
    }

    /* "bpf4/core.pyx":1961
 *                     "The instantiation form x0, y0, x1, y1 should have an even number of args"
 *                 )
 *             if lenpoints == 2:             # <<<<<<<<<<<<<<
 *                 return cls((points[0], points[1]), (points[0], points[1]), **kws)
 *             elif lenpoints == 1:
 */
    switch (__pyx_v_lenpoints) {
      case 2:

      /* "bpf4/core.pyx":1962
 *                 )
 *             if lenpoints == 2:
 *                 return cls((points[0], points[1]), (points[0], points[1]), **kws)             # <<<<<<<<<<<<<<
 *             elif lenpoints == 1:
 *                 return cls((0, 0), (0, points[0]), **kws)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1962, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_points, 0));
      __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_points, 0));
      PyTuple_SET_ITEM(__pyx_t_7, 0, PyTuple_GET_ITEM(__pyx_v_points, 0));
      __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_points, 1));
      __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_points, 1));
      PyTuple_SET_ITEM(__pyx_t_7, 1, PyTuple_GET_ITEM(__pyx_v_points, 1));
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1962, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_points, 0));
      __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_points, 0));
      PyTuple_SET_ITEM(__pyx_t_6, 0, PyTuple_GET_ITEM(__pyx_v_points, 0));
      __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_points, 1));
      __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_points, 1));
      PyTuple_SET_ITEM(__pyx_t_6, 1, PyTuple_GET_ITEM(__pyx_v_points, 1));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1962, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
      __pyx_t_7 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyDict_Copy(__pyx_v_kws); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1962, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1962, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":1961
 *                     "The instantiation form x0, y0, x1, y1 should have an even number of args"
 *                 )
 *             if lenpoints == 2:             # <<<<<<<<<<<<<<
 *                 return cls((points[0], points[1]), (points[0], points[1]), **kws)
 *             elif lenpoints == 1:
 */
      break;
      case 1:

      /* "bpf4/core.pyx":1964
 *                 return cls((points[0], points[1]), (points[0], points[1]), **kws)
 *             elif lenpoints == 1:
 *                 return cls((0, 0), (0, points[0]), **kws)             # <<<<<<<<<<<<<<
 *             else:
 *                 return cls(points[::2], points[1::2], **kws)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1964, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_int_0);
      __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_points, 0));
      __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_points, 0));
      PyTuple_SET_ITEM(__pyx_t_7, 1, PyTuple_GET_ITEM(__pyx_v_points, 0));
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1964, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_tuple__18);
      __Pyx_GIVEREF(__pyx_tuple__18);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_tuple__18);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyDict_Copy(__pyx_v_kws); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1964, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1964, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":1963
 *             if lenpoints == 2:
 *                 return cls((points[0], points[1]), (points[0], points[1]), **kws)
 *             elif lenpoints == 1:             # <<<<<<<<<<<<<<
 *                 return cls((0, 0), (0, points[0]), **kws)
 *             else:
 */
      break;
      default:

      /* "bpf4/core.pyx":1966
 *                 return cls((0, 0), (0, points[0]), **kws)
 *             else:
 *                 return cls(points[::2], points[1::2], **kws)             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_slice__19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1966, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_slice__20); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1966, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1966, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
      __pyx_t_2 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = PyDict_Copy(__pyx_v_kws); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1966, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1966, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      break;
    }
  }

  /* "bpf4/core.pyx":1925
 * 
 *     @classmethod
 *     def fromseq(cls, *points, **kws):             # <<<<<<<<<<<<<<
 *         """
 *         A helper constructor, in this variant points are given as tuples or as a flat sequence.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.fromseq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1968
 *                 return cls(points[::2], points[1::2], **kws)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create a copy of this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_143copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_142copy[] = "BpfInterface.copy(self)\n\n        Create a copy of this bpf\n\n        Returns:\n            (BpfInterface) A copy of this bpf\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_143copy = {"copy", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_143copy, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_142copy};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_143copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_142copy(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_142copy(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_v_obj = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "bpf4/core.pyx":1975
 *             (BpfInterface) A copy of this bpf
 *         """
 *         state = self.__getstate__()             # <<<<<<<<<<<<<<
 *         obj = self.__class__(*state)
 *         obj.__setstate__(state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":1976
 *         """
 *         state = self.__getstate__()
 *         obj = self.__class__(*state)             # <<<<<<<<<<<<<<
 *         obj.__setstate__(state)
 *         return obj
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1976, __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;
  __pyx_v_obj = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bpf4/core.pyx":1977
 *         state = self.__getstate__()
 *         obj = self.__class__(*state)
 *         obj.__setstate__(state)             # <<<<<<<<<<<<<<
 *         return obj
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_setstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_state) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_state);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "bpf4/core.pyx":1978
 *         obj = self.__class__(*state)
 *         obj.__setstate__(state)
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1968
 *                 return cls(points[::2], points[1::2], **kws)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create a copy of this bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1980
 *         return obj
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         x0, x1 = self.bounds()
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(x0), str(x1))
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_145__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_145__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_144__repr__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_144__repr__(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self) {
  PyObject *__pyx_v_x0 = NULL;
  PyObject *__pyx_v_x1 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "bpf4/core.pyx":1981
 * 
 *     def __repr__(self):
 *         x0, x1 = self.bounds()             # <<<<<<<<<<<<<<
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(x0), str(x1))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bounds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1981, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1981, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1981, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x0 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_x1 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bpf4/core.pyx":1982
 *     def __repr__(self):
 *         x0, x1 = self.bounds()
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(x0), str(x1))             # <<<<<<<<<<<<<<
 * 
 *     def debug(self, key, value=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = 0;
  __pyx_t_7 = 127;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u__21);
  __pyx_t_6 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__21);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__21);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u__22);
  __pyx_t_6 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__22);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__22);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_x1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u__23);
  __pyx_t_6 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__23);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u__23);
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 6, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":1980
 *         return obj
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         x0, x1 = self.bounds()
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(x0), str(x1))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x0);
  __Pyx_XDECREF(__pyx_v_x1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1984
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(x0), str(x1))
 * 
 *     def debug(self, key, value=None):             # <<<<<<<<<<<<<<
 *         """
 *         keys:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_147debug(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12BpfInterface_146debug[] = "BpfInterface.debug(self, key, value=None)\n\n        keys:\n            * integrationmode\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_12BpfInterface_147debug = {"debug", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_147debug, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_146debug};
static PyObject *__pyx_pw_4bpf4_4core_12BpfInterface_147debug(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("debug (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "debug") < 0)) __PYX_ERR(0, 1984, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_key = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("debug", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1984, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfInterface.debug", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12BpfInterface_146debug(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12BpfInterface_146debug(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("debug", 0);

  /* "bpf4/core.pyx":1989
 *             * integrationmode
 *         """
 *         if key == "integrationmode":             # <<<<<<<<<<<<<<
 *             if value is not None:
 *                 self._integration_mode = value
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_key, __pyx_n_u_integrationmode, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1989, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":1990
 *         """
 *         if key == "integrationmode":
 *             if value is not None:             # <<<<<<<<<<<<<<
 *                 self._integration_mode = value
 *             return self._integration_mode
 */
    __pyx_t_1 = (__pyx_v_value != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":1991
 *         if key == "integrationmode":
 *             if value is not None:
 *                 self._integration_mode = value             # <<<<<<<<<<<<<<
 *             return self._integration_mode
 * 
 */
      __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1991, __pyx_L1_error)
      __pyx_v_self->_integration_mode = __pyx_t_3;

      /* "bpf4/core.pyx":1990
 *         """
 *         if key == "integrationmode":
 *             if value is not None:             # <<<<<<<<<<<<<<
 *                 self._integration_mode = value
 *             return self._integration_mode
 */
    }

    /* "bpf4/core.pyx":1992
 *             if value is not None:
 *                 self._integration_mode = value
 *             return self._integration_mode             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->_integration_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":1989
 *             * integrationmode
 *         """
 *         if key == "integrationmode":             # <<<<<<<<<<<<<<
 *             if value is not None:
 *                 self._integration_mode = value
 */
  }

  /* "bpf4/core.pyx":1984
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(x0), str(x1))
 * 
 *     def debug(self, key, value=None):             # <<<<<<<<<<<<<<
 *         """
 *         keys:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.BpfInterface.debug", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":1995
 * 
 * 
 * cdef BpfInterface _asbpf(obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, BpfInterface):
 *         return obj
 */

static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core__asbpf(PyObject *__pyx_v_obj) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_asbpf", 0);

  /* "bpf4/core.pyx":1996
 * 
 * cdef BpfInterface _asbpf(obj):
 *     if isinstance(obj, BpfInterface):             # <<<<<<<<<<<<<<
 *         return obj
 *     if hasattr(obj, '__call__'):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":1997
 * cdef BpfInterface _asbpf(obj):
 *     if isinstance(obj, BpfInterface):
 *         return obj             # <<<<<<<<<<<<<<
 *     if hasattr(obj, '__call__'):
 *         return _FunctionWrap(obj, (INFNEG, INF))
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    if (!(likely(((__pyx_v_obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 1997, __pyx_L1_error)
    __Pyx_INCREF(__pyx_v_obj);
    __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_obj);
    goto __pyx_L0;

    /* "bpf4/core.pyx":1996
 * 
 * cdef BpfInterface _asbpf(obj):
 *     if isinstance(obj, BpfInterface):             # <<<<<<<<<<<<<<
 *         return obj
 *     if hasattr(obj, '__call__'):
 */
  }

  /* "bpf4/core.pyx":1998
 *     if isinstance(obj, BpfInterface):
 *         return obj
 *     if hasattr(obj, '__call__'):             # <<<<<<<<<<<<<<
 *         return _FunctionWrap(obj, (INFNEG, INF))
 *     elif hasattr(obj, '__float__'):
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_u_call); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1998, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":1999
 *         return obj
 *     if hasattr(obj, '__call__'):
 *         return _FunctionWrap(obj, (INFNEG, INF))             # <<<<<<<<<<<<<<
 *     elif hasattr(obj, '__float__'):
 *         return Const(float(obj))
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FunctionWrap); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_tuple__5};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1999, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_obj, __pyx_tuple__5};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1999, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1999, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_obj);
      __Pyx_INCREF(__pyx_tuple__5);
      __Pyx_GIVEREF(__pyx_tuple__5);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_tuple__5);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1999, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 1999, __pyx_L1_error)
    __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":1998
 *     if isinstance(obj, BpfInterface):
 *         return obj
 *     if hasattr(obj, '__call__'):             # <<<<<<<<<<<<<<
 *         return _FunctionWrap(obj, (INFNEG, INF))
 *     elif hasattr(obj, '__float__'):
 */
  }

  /* "bpf4/core.pyx":2000
 *     if hasattr(obj, '__call__'):
 *         return _FunctionWrap(obj, (INFNEG, INF))
 *     elif hasattr(obj, '__float__'):             # <<<<<<<<<<<<<<
 *         return Const(float(obj))
 *     else:
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_u_float); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2000, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":2001
 *         return _FunctionWrap(obj, (INFNEG, INF))
 *     elif hasattr(obj, '__float__'):
 *         return Const(float(obj))             # <<<<<<<<<<<<<<
 *     else:
 *         return None
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4bpf4_4core_Const), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":2000
 *     if hasattr(obj, '__call__'):
 *         return _FunctionWrap(obj, (INFNEG, INF))
 *     elif hasattr(obj, '__float__'):             # <<<<<<<<<<<<<<
 *         return Const(float(obj))
 *     else:
 */
  }

  /* "bpf4/core.pyx":2003
 *         return Const(float(obj))
 *     else:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":1995
 * 
 * 
 * cdef BpfInterface _asbpf(obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, BpfInterface):
 *         return obj
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bpf4.core._asbpf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2006
 * 
 * 
 * cdef inline ndarray _asarray(obj):             # <<<<<<<<<<<<<<
 *     return <ndarray>(PyArray_GETCONTIGUOUS(array(obj, DTYPE, False)))
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_4bpf4_4core__asarray(PyObject *__pyx_v_obj) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_asarray", 0);

  /* "bpf4/core.pyx":2007
 * 
 * cdef inline ndarray _asarray(obj):
 *     return <ndarray>(PyArray_GETCONTIGUOUS(array(obj, DTYPE, False)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_obj, __pyx_t_3, Py_False};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2007, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_obj, __pyx_t_3, Py_False};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2007, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_obj);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, Py_False);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2007, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)PyArray_GETCONTIGUOUS(((PyArrayObject *)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2)));
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2006
 * 
 * 
 * cdef inline ndarray _asarray(obj):             # <<<<<<<<<<<<<<
 *     return <ndarray>(PyArray_GETCONTIGUOUS(array(obj, DTYPE, False)))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core._asarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2022
 * 
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.interpol_func = NULL
 *         self.ys_data = NULL
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_7BpfBase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_7BpfBase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase___cinit__(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_7BpfBase___cinit__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "bpf4/core.pyx":2023
 * 
 *     def __cinit__(self):
 *         self.interpol_func = NULL             # <<<<<<<<<<<<<<
 *         self.ys_data = NULL
 *         self.xs_data = NULL
 */
  __pyx_v_self->interpol_func = NULL;

  /* "bpf4/core.pyx":2024
 *     def __cinit__(self):
 *         self.interpol_func = NULL
 *         self.ys_data = NULL             # <<<<<<<<<<<<<<
 *         self.xs_data = NULL
 *         self.xs = None
 */
  __pyx_v_self->ys_data = NULL;

  /* "bpf4/core.pyx":2025
 *         self.interpol_func = NULL
 *         self.ys_data = NULL
 *         self.xs_data = NULL             # <<<<<<<<<<<<<<
 *         self.xs = None
 *         self.ys = None
 */
  __pyx_v_self->xs_data = NULL;

  /* "bpf4/core.pyx":2026
 *         self.ys_data = NULL
 *         self.xs_data = NULL
 *         self.xs = None             # <<<<<<<<<<<<<<
 *         self.ys = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->xs);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->xs));
  __pyx_v_self->xs = ((PyArrayObject *)Py_None);

  /* "bpf4/core.pyx":2027
 *         self.xs_data = NULL
 *         self.xs = None
 *         self.ys = None             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->ys);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->ys));
  __pyx_v_self->ys = ((PyArrayObject *)Py_None);

  /* "bpf4/core.pyx":2022
 * 
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.interpol_func = NULL
 *         self.ys_data = NULL
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2029
 *         self.ys = None
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         InterpolFunc_free(self.interpol_func)
 * 
 */

/* Python wrapper */
static void __pyx_pw_4bpf4_4core_7BpfBase_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_4bpf4_4core_7BpfBase_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_4bpf4_4core_7BpfBase_2__dealloc__(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_4bpf4_4core_7BpfBase_2__dealloc__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "bpf4/core.pyx":2030
 * 
 *     def __dealloc__(self):
 *         InterpolFunc_free(self.interpol_func)             # <<<<<<<<<<<<<<
 * 
 *     def __init__(BpfBase self, xs, ys):
 */
  __pyx_f_4bpf4_4core_InterpolFunc_free(__pyx_v_self->interpol_func);

  /* "bpf4/core.pyx":2029
 *         self.ys = None
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         InterpolFunc_free(self.interpol_func)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":2032
 *         InterpolFunc_free(self.interpol_func)
 * 
 *     def __init__(BpfBase self, xs, ys):             # <<<<<<<<<<<<<<
 *         """
 *         Base constructor for bpfs
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_7BpfBase_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_4__init__[] = "\n        Base constructor for bpfs\n\n        xs and ys should be of the same size\n\n        Args:\n            xs (list[float] | numpy.ndarray): x data \n            ys (list[float] | numpy.ndarray): y data\n\n\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_7BpfBase_4__init__;
#endif
static int __pyx_pw_4bpf4_4core_7BpfBase_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2032, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2032, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2032, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_4__init__(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_7BpfBase_4__init__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys) {
  int __pyx_v_len_xs;
  int __pyx_v_len_ys;
  PyArrayObject *__pyx_v__xs = 0;
  PyArrayObject *__pyx_v__ys = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd__xs;
  __Pyx_Buffer __pyx_pybuffer__xs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd__ys;
  __Pyx_Buffer __pyx_pybuffer__ys;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_9;
  PyArrayObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_UCS4 __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  double __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_pybuffer__xs.pybuffer.buf = NULL;
  __pyx_pybuffer__xs.refcount = 0;
  __pyx_pybuffernd__xs.data = NULL;
  __pyx_pybuffernd__xs.rcbuffer = &__pyx_pybuffer__xs;
  __pyx_pybuffer__ys.pybuffer.buf = NULL;
  __pyx_pybuffer__ys.refcount = 0;
  __pyx_pybuffernd__ys.data = NULL;
  __pyx_pybuffernd__ys.rcbuffer = &__pyx_pybuffer__ys;

  /* "bpf4/core.pyx":2045
 *         """
 *         cdef int len_xs, len_ys
 *         cdef ndarray [DTYPE_t, ndim=1] _xs = numpy.ascontiguousarray(xs, DTYPE)             # <<<<<<<<<<<<<<
 *         if _array_issorted(_xs) < 1:
 *             raise BpfPointsError(f"Points along the x coord should be sorted without duplicates.\n xs:\n{xs}")
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_xs);
    __Pyx_GIVEREF(__pyx_v_xs);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_xs);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2045, __pyx_L1_error)
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd__xs.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v__xs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd__xs.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 2045, __pyx_L1_error)
    } else {__pyx_pybuffernd__xs.diminfo[0].strides = __pyx_pybuffernd__xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd__xs.diminfo[0].shape = __pyx_pybuffernd__xs.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v__xs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2046
 *         cdef int len_xs, len_ys
 *         cdef ndarray [DTYPE_t, ndim=1] _xs = numpy.ascontiguousarray(xs, DTYPE)
 *         if _array_issorted(_xs) < 1:             # <<<<<<<<<<<<<<
 *             raise BpfPointsError(f"Points along the x coord should be sorted without duplicates.\n xs:\n{xs}")
 *         cdef ndarray [DTYPE_t, ndim=1] _ys = numpy.ascontiguousarray(ys, DTYPE)
 */
  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(((PyObject *)__pyx_v__xs), PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 2046, __pyx_L1_error)
  __pyx_t_9 = ((__pyx_f_4bpf4_4core__array_issorted(__pyx_t_8, 0) < 1) != 0);
  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
  __pyx_t_8.memview = NULL;
  __pyx_t_8.data = NULL;
  if (unlikely(__pyx_t_9)) {

    /* "bpf4/core.pyx":2047
 *         cdef ndarray [DTYPE_t, ndim=1] _xs = numpy.ascontiguousarray(xs, DTYPE)
 *         if _array_issorted(_xs) < 1:
 *             raise BpfPointsError(f"Points along the x coord should be sorted without duplicates.\n xs:\n{xs}")             # <<<<<<<<<<<<<<
 *         cdef ndarray [DTYPE_t, ndim=1] _ys = numpy.ascontiguousarray(ys, DTYPE)
 *         len_xs = PyArray_DIM(_xs, 0)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BpfPointsError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_xs, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Points_along_the_x_coord_should, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2047, __pyx_L1_error)

    /* "bpf4/core.pyx":2046
 *         cdef int len_xs, len_ys
 *         cdef ndarray [DTYPE_t, ndim=1] _xs = numpy.ascontiguousarray(xs, DTYPE)
 *         if _array_issorted(_xs) < 1:             # <<<<<<<<<<<<<<
 *             raise BpfPointsError(f"Points along the x coord should be sorted without duplicates.\n xs:\n{xs}")
 *         cdef ndarray [DTYPE_t, ndim=1] _ys = numpy.ascontiguousarray(ys, DTYPE)
 */
  }

  /* "bpf4/core.pyx":2048
 *         if _array_issorted(_xs) < 1:
 *             raise BpfPointsError(f"Points along the x coord should be sorted without duplicates.\n xs:\n{xs}")
 *         cdef ndarray [DTYPE_t, ndim=1] _ys = numpy.ascontiguousarray(ys, DTYPE)             # <<<<<<<<<<<<<<
 *         len_xs = PyArray_DIM(_xs, 0)
 *         len_ys = PyArray_DIM(_ys, 0)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_ys, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2048, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_ys, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2048, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_ys);
    __Pyx_GIVEREF(__pyx_v_ys);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_ys);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2048, __pyx_L1_error)
  __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd__ys.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v__ys = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd__ys.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 2048, __pyx_L1_error)
    } else {__pyx_pybuffernd__ys.diminfo[0].strides = __pyx_pybuffernd__ys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd__ys.diminfo[0].shape = __pyx_pybuffernd__ys.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_10 = 0;
  __pyx_v__ys = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2049
 *             raise BpfPointsError(f"Points along the x coord should be sorted without duplicates.\n xs:\n{xs}")
 *         cdef ndarray [DTYPE_t, ndim=1] _ys = numpy.ascontiguousarray(ys, DTYPE)
 *         len_xs = PyArray_DIM(_xs, 0)             # <<<<<<<<<<<<<<
 *         len_ys = PyArray_DIM(_ys, 0)
 *         if len_xs != len_ys:
 */
  __pyx_v_len_xs = PyArray_DIM(((PyArrayObject *)__pyx_v__xs), 0);

  /* "bpf4/core.pyx":2050
 *         cdef ndarray [DTYPE_t, ndim=1] _ys = numpy.ascontiguousarray(ys, DTYPE)
 *         len_xs = PyArray_DIM(_xs, 0)
 *         len_ys = PyArray_DIM(_ys, 0)             # <<<<<<<<<<<<<<
 *         if len_xs != len_ys:
 *             raise ValueError("xs and ys must be of equal length, but xs has %d items "
 */
  __pyx_v_len_ys = PyArray_DIM(((PyArrayObject *)__pyx_v__ys), 0);

  /* "bpf4/core.pyx":2051
 *         len_xs = PyArray_DIM(_xs, 0)
 *         len_ys = PyArray_DIM(_ys, 0)
 *         if len_xs != len_ys:             # <<<<<<<<<<<<<<
 *             raise ValueError("xs and ys must be of equal length, but xs has %d items "
 *                              "and ys has %d items" % (len_xs, len_ys))
 */
  __pyx_t_9 = ((__pyx_v_len_xs != __pyx_v_len_ys) != 0);
  if (unlikely(__pyx_t_9)) {

    /* "bpf4/core.pyx":2052
 *         len_ys = PyArray_DIM(_ys, 0)
 *         if len_xs != len_ys:
 *             raise ValueError("xs and ys must be of equal length, but xs has %d items "             # <<<<<<<<<<<<<<
 *                              "and ys has %d items" % (len_xs, len_ys))
 *         if len_xs < 1:
 */
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = 0;
    __pyx_t_12 = 127;
    __Pyx_INCREF(__pyx_kp_u_xs_and_ys_must_be_of_equal_lengt);
    __pyx_t_11 += 46;
    __Pyx_GIVEREF(__pyx_kp_u_xs_and_ys_must_be_of_equal_lengt);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_xs_and_ys_must_be_of_equal_lengt);

    /* "bpf4/core.pyx":2053
 *         if len_xs != len_ys:
 *             raise ValueError("xs and ys must be of equal length, but xs has %d items "
 *                              "and ys has %d items" % (len_xs, len_ys))             # <<<<<<<<<<<<<<
 *         if len_xs < 1:
 *             raise ValueError("Can't creat a BPF of 0 points")
 */
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_len_xs, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u_items_and_ys_has);
    __pyx_t_11 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_items_and_ys_has);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_items_and_ys_has);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_len_ys, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u_items_2);
    __pyx_t_11 += 6;
    __Pyx_GIVEREF(__pyx_kp_u_items_2);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_items_2);

    /* "bpf4/core.pyx":2052
 *         len_ys = PyArray_DIM(_ys, 0)
 *         if len_xs != len_ys:
 *             raise ValueError("xs and ys must be of equal length, but xs has %d items "             # <<<<<<<<<<<<<<
 *                              "and ys has %d items" % (len_xs, len_ys))
 *         if len_xs < 1:
 */
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2052, __pyx_L1_error)

    /* "bpf4/core.pyx":2051
 *         len_xs = PyArray_DIM(_xs, 0)
 *         len_ys = PyArray_DIM(_ys, 0)
 *         if len_xs != len_ys:             # <<<<<<<<<<<<<<
 *             raise ValueError("xs and ys must be of equal length, but xs has %d items "
 *                              "and ys has %d items" % (len_xs, len_ys))
 */
  }

  /* "bpf4/core.pyx":2054
 *             raise ValueError("xs and ys must be of equal length, but xs has %d items "
 *                              "and ys has %d items" % (len_xs, len_ys))
 *         if len_xs < 1:             # <<<<<<<<<<<<<<
 *             raise ValueError("Can't creat a BPF of 0 points")
 *         self.xs = _xs
 */
  __pyx_t_9 = ((__pyx_v_len_xs < 1) != 0);
  if (unlikely(__pyx_t_9)) {

    /* "bpf4/core.pyx":2055
 *                              "and ys has %d items" % (len_xs, len_ys))
 *         if len_xs < 1:
 *             raise ValueError("Can't creat a BPF of 0 points")             # <<<<<<<<<<<<<<
 *         self.xs = _xs
 *         self.ys = _ys
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2055, __pyx_L1_error)

    /* "bpf4/core.pyx":2054
 *             raise ValueError("xs and ys must be of equal length, but xs has %d items "
 *                              "and ys has %d items" % (len_xs, len_ys))
 *         if len_xs < 1:             # <<<<<<<<<<<<<<
 *             raise ValueError("Can't creat a BPF of 0 points")
 *         self.xs = _xs
 */
  }

  /* "bpf4/core.pyx":2056
 *         if len_xs < 1:
 *             raise ValueError("Can't creat a BPF of 0 points")
 *         self.xs = _xs             # <<<<<<<<<<<<<<
 *         self.ys = _ys
 *         self.xs_size = PyArray_DIM(_xs, 0)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v__xs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v__xs));
  __Pyx_GOTREF(__pyx_v_self->xs);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->xs));
  __pyx_v_self->xs = ((PyArrayObject *)__pyx_v__xs);

  /* "bpf4/core.pyx":2057
 *             raise ValueError("Can't creat a BPF of 0 points")
 *         self.xs = _xs
 *         self.ys = _ys             # <<<<<<<<<<<<<<
 *         self.xs_size = PyArray_DIM(_xs, 0)
 *         self._set_bounds(_xs[0], _xs[len_xs - 1])
 */
  __Pyx_INCREF(((PyObject *)__pyx_v__ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v__ys));
  __Pyx_GOTREF(__pyx_v_self->ys);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->ys));
  __pyx_v_self->ys = ((PyArrayObject *)__pyx_v__ys);

  /* "bpf4/core.pyx":2058
 *         self.xs = _xs
 *         self.ys = _ys
 *         self.xs_size = PyArray_DIM(_xs, 0)             # <<<<<<<<<<<<<<
 *         self._set_bounds(_xs[0], _xs[len_xs - 1])
 *         self.outbound_mode = OUTBOUND_CACHE
 */
  __pyx_v_self->xs_size = PyArray_DIM(((PyArrayObject *)__pyx_v__xs), 0);

  /* "bpf4/core.pyx":2059
 *         self.ys = _ys
 *         self.xs_size = PyArray_DIM(_xs, 0)
 *         self._set_bounds(_xs[0], _xs[len_xs - 1])             # <<<<<<<<<<<<<<
 *         self.outbound_mode = OUTBOUND_CACHE
 *         self.outbound0 = _ys[0]
 */
  __pyx_t_13 = 0;
  __pyx_t_14 = (__pyx_v_len_xs - 1);
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), (*__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd__xs.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd__xs.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd__xs.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd__xs.diminfo[0].strides)));

  /* "bpf4/core.pyx":2060
 *         self.xs_size = PyArray_DIM(_xs, 0)
 *         self._set_bounds(_xs[0], _xs[len_xs - 1])
 *         self.outbound_mode = OUTBOUND_CACHE             # <<<<<<<<<<<<<<
 *         self.outbound0 = _ys[0]
 *         self.outbound1 = _ys[len_ys - 1]
 */
  __pyx_v_self->outbound_mode = 1;

  /* "bpf4/core.pyx":2061
 *         self._set_bounds(_xs[0], _xs[len_xs - 1])
 *         self.outbound_mode = OUTBOUND_CACHE
 *         self.outbound0 = _ys[0]             # <<<<<<<<<<<<<<
 *         self.outbound1 = _ys[len_ys - 1]
 *         self.xs_data = <DTYPE_t*>(self.xs.data)
 */
  __pyx_t_14 = 0;
  __pyx_v_self->outbound0 = (*__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd__ys.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd__ys.diminfo[0].strides));

  /* "bpf4/core.pyx":2062
 *         self.outbound_mode = OUTBOUND_CACHE
 *         self.outbound0 = _ys[0]
 *         self.outbound1 = _ys[len_ys - 1]             # <<<<<<<<<<<<<<
 *         self.xs_data = <DTYPE_t*>(self.xs.data)
 *         self.ys_data = <DTYPE_t*>(self.ys.data)
 */
  __pyx_t_14 = (__pyx_v_len_ys - 1);
  __pyx_v_self->outbound1 = (*__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd__ys.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd__ys.diminfo[0].strides));

  /* "bpf4/core.pyx":2063
 *         self.outbound0 = _ys[0]
 *         self.outbound1 = _ys[len_ys - 1]
 *         self.xs_data = <DTYPE_t*>(self.xs.data)             # <<<<<<<<<<<<<<
 *         self.ys_data = <DTYPE_t*>(self.ys.data)
 *         self.lastbin_x0 = self.xs[0]
 */
  __pyx_v_self->xs_data = ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_self->xs->data);

  /* "bpf4/core.pyx":2064
 *         self.outbound1 = _ys[len_ys - 1]
 *         self.xs_data = <DTYPE_t*>(self.xs.data)
 *         self.ys_data = <DTYPE_t*>(self.ys.data)             # <<<<<<<<<<<<<<
 *         self.lastbin_x0 = self.xs[0]
 *         self.lastbin_x1 = self.xs[1]
 */
  __pyx_v_self->ys_data = ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_self->ys->data);

  /* "bpf4/core.pyx":2065
 *         self.xs_data = <DTYPE_t*>(self.xs.data)
 *         self.ys_data = <DTYPE_t*>(self.ys.data)
 *         self.lastbin_x0 = self.xs[0]             # <<<<<<<<<<<<<<
 *         self.lastbin_x1 = self.xs[1]
 *         self.lastbin_idx1 = 1
 */
  __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->xs), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2065, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->lastbin_x0 = __pyx_t_15;

  /* "bpf4/core.pyx":2066
 *         self.ys_data = <DTYPE_t*>(self.ys.data)
 *         self.lastbin_x0 = self.xs[0]
 *         self.lastbin_x1 = self.xs[1]             # <<<<<<<<<<<<<<
 *         self.lastbin_idx1 = 1
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->xs), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2066, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->lastbin_x1 = __pyx_t_15;

  /* "bpf4/core.pyx":2067
 *         self.lastbin_x0 = self.xs[0]
 *         self.lastbin_x1 = self.xs[1]
 *         self.lastbin_idx1 = 1             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->lastbin_idx1 = 1;

  /* "bpf4/core.pyx":2032
 *         InterpolFunc_free(self.interpol_func)
 * 
 *     def __init__(BpfBase self, xs, ys):             # <<<<<<<<<<<<<<
 *         """
 *         Base constructor for bpfs
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__xs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__ys.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core.BpfBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__xs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__ys.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v__xs);
  __Pyx_XDECREF((PyObject *)__pyx_v__ys);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2070
 * 
 *     @property
 *     def descriptor(self) -> str:             # <<<<<<<<<<<<<<
 *         """
 *         A string describing the interpolation function of this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_10descriptor_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_10descriptor_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_10descriptor___get__(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_10descriptor___get__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bpf4/core.pyx":2074
 *         A string describing the interpolation function of this bpf
 *         """
 *         return InterpolFunc_get_descriptor(self.interpol_func)             # <<<<<<<<<<<<<<
 * 
 *     cdef void _bounds_changed(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4bpf4_4core_InterpolFunc_get_descriptor(__pyx_v_self->interpol_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2070
 * 
 *     @property
 *     def descriptor(self) -> str:             # <<<<<<<<<<<<<<
 *         """
 *         A string describing the interpolation function of this bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfBase.descriptor.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2076
 *         return InterpolFunc_get_descriptor(self.interpol_func)
 * 
 *     cdef void _bounds_changed(self):             # <<<<<<<<<<<<<<
 *         self._invalidate_cache()
 * 
 */

static void __pyx_f_4bpf4_4core_7BpfBase__bounds_changed(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_bounds_changed", 0);

  /* "bpf4/core.pyx":2077
 * 
 *     cdef void _bounds_changed(self):
 *         self._invalidate_cache()             # <<<<<<<<<<<<<<
 * 
 *     cdef void _invalidate_cache(self):
 */
  ((struct __pyx_vtabstruct_4bpf4_4core_BpfBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->_invalidate_cache(__pyx_v_self);

  /* "bpf4/core.pyx":2076
 *         return InterpolFunc_get_descriptor(self.interpol_func)
 * 
 *     cdef void _bounds_changed(self):             # <<<<<<<<<<<<<<
 *         self._invalidate_cache()
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":2079
 *         self._invalidate_cache()
 * 
 *     cdef void _invalidate_cache(self):             # <<<<<<<<<<<<<<
 *         cdef int last_index = PyArray_DIM(self.xs, 0) - 1
 *         self.lastbin_x0 = 0
 */

static void __pyx_f_4bpf4_4core_7BpfBase__invalidate_cache(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self) {
  int __pyx_v_last_index;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("_invalidate_cache", 0);

  /* "bpf4/core.pyx":2080
 * 
 *     cdef void _invalidate_cache(self):
 *         cdef int last_index = PyArray_DIM(self.xs, 0) - 1             # <<<<<<<<<<<<<<
 *         self.lastbin_x0 = 0
 *         self.lastbin_x1 = 0
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->xs);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_last_index = (PyArray_DIM(((PyArrayObject *)__pyx_t_1), 0) - 1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2081
 *     cdef void _invalidate_cache(self):
 *         cdef int last_index = PyArray_DIM(self.xs, 0) - 1
 *         self.lastbin_x0 = 0             # <<<<<<<<<<<<<<
 *         self.lastbin_x1 = 0
 *         self.lastbin_idx1 = 0
 */
  __pyx_v_self->lastbin_x0 = 0.0;

  /* "bpf4/core.pyx":2082
 *         cdef int last_index = PyArray_DIM(self.xs, 0) - 1
 *         self.lastbin_x0 = 0
 *         self.lastbin_x1 = 0             # <<<<<<<<<<<<<<
 *         self.lastbin_idx1 = 0
 *         if self.ys_data != NULL and self.outbound_mode == OUTBOUND_CACHE:
 */
  __pyx_v_self->lastbin_x1 = 0.0;

  /* "bpf4/core.pyx":2083
 *         self.lastbin_x0 = 0
 *         self.lastbin_x1 = 0
 *         self.lastbin_idx1 = 0             # <<<<<<<<<<<<<<
 *         if self.ys_data != NULL and self.outbound_mode == OUTBOUND_CACHE:
 *             self.outbound0 = (<DTYPE_t *>(self.ys_data))[0]
 */
  __pyx_v_self->lastbin_idx1 = 0;

  /* "bpf4/core.pyx":2084
 *         self.lastbin_x1 = 0
 *         self.lastbin_idx1 = 0
 *         if self.ys_data != NULL and self.outbound_mode == OUTBOUND_CACHE:             # <<<<<<<<<<<<<<
 *             self.outbound0 = (<DTYPE_t *>(self.ys_data))[0]
 *             self.outbound1 = (<DTYPE_t *>(self.ys_data))[last_index]
 */
  __pyx_t_3 = ((__pyx_v_self->ys_data != NULL) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_self->outbound_mode == 1) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":2085
 *         self.lastbin_idx1 = 0
 *         if self.ys_data != NULL and self.outbound_mode == OUTBOUND_CACHE:
 *             self.outbound0 = (<DTYPE_t *>(self.ys_data))[0]             # <<<<<<<<<<<<<<
 *             self.outbound1 = (<DTYPE_t *>(self.ys_data))[last_index]
 * 
 */
    __pyx_v_self->outbound0 = (((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_self->ys_data)[0]);

    /* "bpf4/core.pyx":2086
 *         if self.ys_data != NULL and self.outbound_mode == OUTBOUND_CACHE:
 *             self.outbound0 = (<DTYPE_t *>(self.ys_data))[0]
 *             self.outbound1 = (<DTYPE_t *>(self.ys_data))[last_index]             # <<<<<<<<<<<<<<
 * 
 *     def outbound(self, double y0, double y1):
 */
    __pyx_v_self->outbound1 = (((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_self->ys_data)[__pyx_v_last_index]);

    /* "bpf4/core.pyx":2084
 *         self.lastbin_x1 = 0
 *         self.lastbin_idx1 = 0
 *         if self.ys_data != NULL and self.outbound_mode == OUTBOUND_CACHE:             # <<<<<<<<<<<<<<
 *             self.outbound0 = (<DTYPE_t *>(self.ys_data))[0]
 *             self.outbound1 = (<DTYPE_t *>(self.ys_data))[last_index]
 */
  }

  /* "bpf4/core.pyx":2079
 *         self._invalidate_cache()
 * 
 *     cdef void _invalidate_cache(self):             # <<<<<<<<<<<<<<
 *         cdef int last_index = PyArray_DIM(self.xs, 0) - 1
 *         self.lastbin_x0 = 0
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":2088
 *             self.outbound1 = (<DTYPE_t *>(self.ys_data))[last_index]
 * 
 *     def outbound(self, double y0, double y1):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values **inplace** returned when this bpf is evaluated outside its bounds.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_7outbound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_6outbound[] = "BpfBase.outbound(self, double y0, double y1)\n\n        Set the values **inplace** returned when this bpf is evaluated outside its bounds.\n\n        The default behaviour is to interpret the values at the bounds to extend to infinity.\n\n        In order to not change this bpf inplace, use `b.copy().outbound(y0, y1)`\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7BpfBase_7outbound = {"outbound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7BpfBase_7outbound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7BpfBase_6outbound};
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_7outbound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_y0;
  double __pyx_v_y1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outbound (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y0,&__pyx_n_s_y1,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("outbound", 1, 2, 2, 1); __PYX_ERR(0, 2088, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outbound") < 0)) __PYX_ERR(0, 2088, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_y0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_y0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2088, __pyx_L3_error)
    __pyx_v_y1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_y1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2088, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("outbound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2088, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfBase.outbound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_6outbound(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self), __pyx_v_y0, __pyx_v_y1);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_6outbound(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, double __pyx_v_y0, double __pyx_v_y1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outbound", 0);

  /* "bpf4/core.pyx":2096
 *         In order to not change this bpf inplace, use `b.copy().outbound(y0, y1)`
 *         """
 *         self.outbound_mode = OUTBOUND_SET             # <<<<<<<<<<<<<<
 *         self.outbound0 = y0
 *         self.outbound1 = y1
 */
  __pyx_v_self->outbound_mode = 2;

  /* "bpf4/core.pyx":2097
 *         """
 *         self.outbound_mode = OUTBOUND_SET
 *         self.outbound0 = y0             # <<<<<<<<<<<<<<
 *         self.outbound1 = y1
 *         return self
 */
  __pyx_v_self->outbound0 = __pyx_v_y0;

  /* "bpf4/core.pyx":2098
 *         self.outbound_mode = OUTBOUND_SET
 *         self.outbound0 = y0
 *         self.outbound1 = y1             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_v_self->outbound1 = __pyx_v_y1;

  /* "bpf4/core.pyx":2099
 *         self.outbound0 = y0
 *         self.outbound1 = y1
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "bpf4/core.pyx":2088
 *             self.outbound1 = (<DTYPE_t *>(self.ys_data))[last_index]
 * 
 *     def outbound(self, double y0, double y1):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values **inplace** returned when this bpf is evaluated outside its bounds.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2101
 *         return self
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.xs, self.ys)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_9__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_8__getstate__[] = "BpfBase.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_7BpfBase_9__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_9__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_7BpfBase_8__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_9__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_8__getstate__(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_8__getstate__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":2102
 * 
 *     def __getstate__(self):
 *         return (self.xs, self.ys)             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->xs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->xs));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->xs));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->ys));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->ys));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2101
 *         return self
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.xs, self.ys)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfBase.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2104
 *         return (self.xs, self.ys)
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.xs, self.ys = state
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_11__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_10__setstate__[] = "BpfBase.__setstate__(self, state)";
static PyMethodDef __pyx_mdef_4bpf4_4core_7BpfBase_11__setstate__ = {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_11__setstate__, METH_O, __pyx_doc_4bpf4_4core_7BpfBase_10__setstate__};
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_11__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_10__setstate__(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_10__setstate__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "bpf4/core.pyx":2105
 * 
 *     def __setstate__(self, state):
 *         self.xs, self.ys = state             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(BpfBase self, double x) nogil:
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_state))) || (PyList_CheckExact(__pyx_v_state))) {
    PyObject* sequence = __pyx_v_state;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2105, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 2105, __pyx_L1_error)
    __pyx_t_4 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2105, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2105, __pyx_L1_error)
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2105, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->xs);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->xs));
  __pyx_v_self->xs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->ys);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->ys));
  __pyx_v_self->ys = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":2104
 *         return (self.xs, self.ys)
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.xs, self.ys = state
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.BpfBase.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2107
 *         self.xs, self.ys = state
 * 
 *     cdef double __ccall__(BpfBase self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double res, x0, y0, x1, y1
 *         cdef int index0, index1, nx
 */

static double __pyx_f_4bpf4_4core_7BpfBase___ccall__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_res;
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_v_index1;
  double __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  double __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":2110
 *         cdef double res, x0, y0, x1, y1
 *         cdef int index0, index1, nx
 *         if self.lastbin_x0 <= x < self.lastbin_x1:             # <<<<<<<<<<<<<<
 *             res = InterpolFunc_call(self.interpol_func, x, self.lastbin_x0, self.ys_data[self.lastbin_idx1-1],
 *                                     self.lastbin_x1, self.ys_data[self.lastbin_idx1])
 */
  __pyx_t_1 = (__pyx_v_self->lastbin_x0 <= __pyx_v_x);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_x < __pyx_v_self->lastbin_x1);
  }
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":2111
 *         cdef int index0, index1, nx
 *         if self.lastbin_x0 <= x < self.lastbin_x1:
 *             res = InterpolFunc_call(self.interpol_func, x, self.lastbin_x0, self.ys_data[self.lastbin_idx1-1],             # <<<<<<<<<<<<<<
 *                                     self.lastbin_x1, self.ys_data[self.lastbin_idx1])
 *         elif x < self._x0:
 */
    __pyx_v_res = __pyx_f_4bpf4_4core_InterpolFunc_call(__pyx_v_self->interpol_func, __pyx_v_x, __pyx_v_self->lastbin_x0, (__pyx_v_self->ys_data[(__pyx_v_self->lastbin_idx1 - 1)]), __pyx_v_self->lastbin_x1, (__pyx_v_self->ys_data[__pyx_v_self->lastbin_idx1]));

    /* "bpf4/core.pyx":2110
 *         cdef double res, x0, y0, x1, y1
 *         cdef int index0, index1, nx
 *         if self.lastbin_x0 <= x < self.lastbin_x1:             # <<<<<<<<<<<<<<
 *             res = InterpolFunc_call(self.interpol_func, x, self.lastbin_x0, self.ys_data[self.lastbin_idx1-1],
 *                                     self.lastbin_x1, self.ys_data[self.lastbin_idx1])
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2113
 *             res = InterpolFunc_call(self.interpol_func, x, self.lastbin_x0, self.ys_data[self.lastbin_idx1-1],
 *                                     self.lastbin_x1, self.ys_data[self.lastbin_idx1])
 *         elif x < self._x0:             # <<<<<<<<<<<<<<
 *             res = self.outbound0
 *         elif x > self._x1:
 */
  __pyx_t_2 = ((__pyx_v_x < __pyx_v_self->__pyx_base._x0) != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":2114
 *                                     self.lastbin_x1, self.ys_data[self.lastbin_idx1])
 *         elif x < self._x0:
 *             res = self.outbound0             # <<<<<<<<<<<<<<
 *         elif x > self._x1:
 *             res = self.outbound1
 */
    __pyx_t_3 = __pyx_v_self->outbound0;
    __pyx_v_res = __pyx_t_3;

    /* "bpf4/core.pyx":2113
 *             res = InterpolFunc_call(self.interpol_func, x, self.lastbin_x0, self.ys_data[self.lastbin_idx1-1],
 *                                     self.lastbin_x1, self.ys_data[self.lastbin_idx1])
 *         elif x < self._x0:             # <<<<<<<<<<<<<<
 *             res = self.outbound0
 *         elif x > self._x1:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2115
 *         elif x < self._x0:
 *             res = self.outbound0
 *         elif x > self._x1:             # <<<<<<<<<<<<<<
 *             res = self.outbound1
 *         elif (self.lastbin_idx1 < self.xs_size - 2) and (self.lastbin_x1 <= x < self.xs_data[self.lastbin_idx1+1]):
 */
  __pyx_t_2 = ((__pyx_v_x > __pyx_v_self->__pyx_base._x1) != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":2116
 *             res = self.outbound0
 *         elif x > self._x1:
 *             res = self.outbound1             # <<<<<<<<<<<<<<
 *         elif (self.lastbin_idx1 < self.xs_size - 2) and (self.lastbin_x1 <= x < self.xs_data[self.lastbin_idx1+1]):
 *             # usual situation: cross to next bin
 */
    __pyx_t_3 = __pyx_v_self->outbound1;
    __pyx_v_res = __pyx_t_3;

    /* "bpf4/core.pyx":2115
 *         elif x < self._x0:
 *             res = self.outbound0
 *         elif x > self._x1:             # <<<<<<<<<<<<<<
 *             res = self.outbound1
 *         elif (self.lastbin_idx1 < self.xs_size - 2) and (self.lastbin_x1 <= x < self.xs_data[self.lastbin_idx1+1]):
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2117
 *         elif x > self._x1:
 *             res = self.outbound1
 *         elif (self.lastbin_idx1 < self.xs_size - 2) and (self.lastbin_x1 <= x < self.xs_data[self.lastbin_idx1+1]):             # <<<<<<<<<<<<<<
 *             # usual situation: cross to next bin
 *             index1 = self.lastbin_idx1 + 1
 */
  __pyx_t_1 = ((__pyx_v_self->lastbin_idx1 < (__pyx_v_self->xs_size - 2)) != 0);
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = (__pyx_v_self->lastbin_x1 <= __pyx_v_x);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_x < (__pyx_v_self->xs_data[(__pyx_v_self->lastbin_idx1 + 1)]));
  }
  __pyx_t_4 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":2119
 *         elif (self.lastbin_idx1 < self.xs_size - 2) and (self.lastbin_x1 <= x < self.xs_data[self.lastbin_idx1+1]):
 *             # usual situation: cross to next bin
 *             index1 = self.lastbin_idx1 + 1             # <<<<<<<<<<<<<<
 *             x1 = self.xs_data[index1]
 *             res = InterpolFunc_call(self.interpol_func, x, self.lastbin_x1, self.ys_data[index1-1], x1, self.ys_data[index1])
 */
    __pyx_v_index1 = (__pyx_v_self->lastbin_idx1 + 1);

    /* "bpf4/core.pyx":2120
 *             # usual situation: cross to next bin
 *             index1 = self.lastbin_idx1 + 1
 *             x1 = self.xs_data[index1]             # <<<<<<<<<<<<<<
 *             res = InterpolFunc_call(self.interpol_func, x, self.lastbin_x1, self.ys_data[index1-1], x1, self.ys_data[index1])
 *             self.lastbin_x0 = self.lastbin_x1
 */
    __pyx_v_x1 = (__pyx_v_self->xs_data[__pyx_v_index1]);

    /* "bpf4/core.pyx":2121
 *             index1 = self.lastbin_idx1 + 1
 *             x1 = self.xs_data[index1]
 *             res = InterpolFunc_call(self.interpol_func, x, self.lastbin_x1, self.ys_data[index1-1], x1, self.ys_data[index1])             # <<<<<<<<<<<<<<
 *             self.lastbin_x0 = self.lastbin_x1
 *             self.lastbin_x1 = x1
 */
    __pyx_v_res = __pyx_f_4bpf4_4core_InterpolFunc_call(__pyx_v_self->interpol_func, __pyx_v_x, __pyx_v_self->lastbin_x1, (__pyx_v_self->ys_data[(__pyx_v_index1 - 1)]), __pyx_v_x1, (__pyx_v_self->ys_data[__pyx_v_index1]));

    /* "bpf4/core.pyx":2122
 *             x1 = self.xs_data[index1]
 *             res = InterpolFunc_call(self.interpol_func, x, self.lastbin_x1, self.ys_data[index1-1], x1, self.ys_data[index1])
 *             self.lastbin_x0 = self.lastbin_x1             # <<<<<<<<<<<<<<
 *             self.lastbin_x1 = x1
 *             self.lastbin_idx1 = index1
 */
    __pyx_t_3 = __pyx_v_self->lastbin_x1;
    __pyx_v_self->lastbin_x0 = __pyx_t_3;

    /* "bpf4/core.pyx":2123
 *             res = InterpolFunc_call(self.interpol_func, x, self.lastbin_x1, self.ys_data[index1-1], x1, self.ys_data[index1])
 *             self.lastbin_x0 = self.lastbin_x1
 *             self.lastbin_x1 = x1             # <<<<<<<<<<<<<<
 *             self.lastbin_idx1 = index1
 *         else:
 */
    __pyx_v_self->lastbin_x1 = __pyx_v_x1;

    /* "bpf4/core.pyx":2124
 *             self.lastbin_x0 = self.lastbin_x1
 *             self.lastbin_x1 = x1
 *             self.lastbin_idx1 = index1             # <<<<<<<<<<<<<<
 *         else:
 *             # out of cache call, find new boundaries and update cache
 */
    __pyx_v_self->lastbin_idx1 = __pyx_v_index1;

    /* "bpf4/core.pyx":2117
 *         elif x > self._x1:
 *             res = self.outbound1
 *         elif (self.lastbin_idx1 < self.xs_size - 2) and (self.lastbin_x1 <= x < self.xs_data[self.lastbin_idx1+1]):             # <<<<<<<<<<<<<<
 *             # usual situation: cross to next bin
 *             index1 = self.lastbin_idx1 + 1
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2127
 *         else:
 *             # out of cache call, find new boundaries and update cache
 *             index1 = _csearchsorted(self.xs_data, self.xs_size, x)             # <<<<<<<<<<<<<<
 *             x0 = self.xs_data[index1-1]
 *             x1 = self.xs_data[index1]
 */
  /*else*/ {
    __pyx_v_index1 = __pyx_f_4bpf4_4core__csearchsorted(__pyx_v_self->xs_data, __pyx_v_self->xs_size, __pyx_v_x);

    /* "bpf4/core.pyx":2128
 *             # out of cache call, find new boundaries and update cache
 *             index1 = _csearchsorted(self.xs_data, self.xs_size, x)
 *             x0 = self.xs_data[index1-1]             # <<<<<<<<<<<<<<
 *             x1 = self.xs_data[index1]
 *             res = InterpolFunc_call(self.interpol_func, x, x0, self.ys_data[index1-1], x1, self.ys_data[index1])
 */
    __pyx_v_x0 = (__pyx_v_self->xs_data[(__pyx_v_index1 - 1)]);

    /* "bpf4/core.pyx":2129
 *             index1 = _csearchsorted(self.xs_data, self.xs_size, x)
 *             x0 = self.xs_data[index1-1]
 *             x1 = self.xs_data[index1]             # <<<<<<<<<<<<<<
 *             res = InterpolFunc_call(self.interpol_func, x, x0, self.ys_data[index1-1], x1, self.ys_data[index1])
 *             self.lastbin_x0 = x0
 */
    __pyx_v_x1 = (__pyx_v_self->xs_data[__pyx_v_index1]);

    /* "bpf4/core.pyx":2130
 *             x0 = self.xs_data[index1-1]
 *             x1 = self.xs_data[index1]
 *             res = InterpolFunc_call(self.interpol_func, x, x0, self.ys_data[index1-1], x1, self.ys_data[index1])             # <<<<<<<<<<<<<<
 *             self.lastbin_x0 = x0
 *             self.lastbin_x1 = x1
 */
    __pyx_v_res = __pyx_f_4bpf4_4core_InterpolFunc_call(__pyx_v_self->interpol_func, __pyx_v_x, __pyx_v_x0, (__pyx_v_self->ys_data[(__pyx_v_index1 - 1)]), __pyx_v_x1, (__pyx_v_self->ys_data[__pyx_v_index1]));

    /* "bpf4/core.pyx":2131
 *             x1 = self.xs_data[index1]
 *             res = InterpolFunc_call(self.interpol_func, x, x0, self.ys_data[index1-1], x1, self.ys_data[index1])
 *             self.lastbin_x0 = x0             # <<<<<<<<<<<<<<
 *             self.lastbin_x1 = x1
 *             self.lastbin_idx1 = index1
 */
    __pyx_v_self->lastbin_x0 = __pyx_v_x0;

    /* "bpf4/core.pyx":2132
 *             res = InterpolFunc_call(self.interpol_func, x, x0, self.ys_data[index1-1], x1, self.ys_data[index1])
 *             self.lastbin_x0 = x0
 *             self.lastbin_x1 = x1             # <<<<<<<<<<<<<<
 *             self.lastbin_idx1 = index1
 *         return res
 */
    __pyx_v_self->lastbin_x1 = __pyx_v_x1;

    /* "bpf4/core.pyx":2133
 *             self.lastbin_x0 = x0
 *             self.lastbin_x1 = x1
 *             self.lastbin_idx1 = index1             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
    __pyx_v_self->lastbin_idx1 = __pyx_v_index1;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":2134
 *             self.lastbin_x1 = x1
 *             self.lastbin_idx1 = index1
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray mapn_between(self, int n, double xstart, double xend, ndarray out=None):
 */
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2107
 *         self.xs, self.ys = state
 * 
 *     cdef double __ccall__(BpfBase self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double res, x0, y0, x1, y1
 *         cdef int index0, index1, nx
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":2136
 *         return res
 * 
 *     cpdef ndarray mapn_between(self, int n, double xstart, double xend, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)
 *         cdef double dx = _ntodx(n, xstart, xend)
 */

static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_13mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_7BpfBase_mapn_between(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, int __pyx_v_n, double __pyx_v_xstart, double __pyx_v_xend, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7BpfBase_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  __Pyx_memviewslice __pyx_v_result = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_dx;
  double __pyx_v_x;
  size_t __pyx_v_i;
  size_t __pyx_v_j;
  double __pyx_v_outbound1;
  double __pyx_v_outbound0;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_xs_data;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_ys_data;
  double __pyx_v_xs_data0;
  double __pyx_v_xs_data1;
  double __pyx_v_ys_data0;
  double __pyx_v_ys_data1;
  double __pyx_v_x1;
  int64_t __pyx_v_index0;
  CYTHON_UNUSED double __pyx_v_interpmix;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_11;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_t_13;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_t_14;
  long __pyx_t_15;
  long __pyx_t_16;
  size_t __pyx_t_17;
  size_t __pyx_t_18;
  size_t __pyx_t_19;
  size_t __pyx_t_20;
  int __pyx_t_21;
  int __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_7BpfBase_13mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_xstart); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_xend); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2136, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2136, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2136, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2136, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2136, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2136, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":2137
 * 
 *     cpdef ndarray mapn_between(self, int n, double xstart, double xend, ndarray out=None):
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)             # <<<<<<<<<<<<<<
 *         cdef double dx = _ntodx(n, xstart, xend)
 *         cdef double x = xstart, y
 */
  __pyx_t_11 = (((PyObject *)__pyx_v_out) != Py_None);
  if ((__pyx_t_11 != 0)) {
    __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(((PyObject *)__pyx_v_out), PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 2137, __pyx_L1_error)
    __pyx_t_10 = __pyx_t_12;
    __pyx_t_12.memview = NULL;
    __pyx_t_12.data = NULL;
  } else {
    __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 2137, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_t_12;
    __pyx_t_12.memview = NULL;
    __pyx_t_12.data = NULL;
  }
  __pyx_v_result = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "bpf4/core.pyx":2138
 *     cpdef ndarray mapn_between(self, int n, double xstart, double xend, ndarray out=None):
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)
 *         cdef double dx = _ntodx(n, xstart, xend)             # <<<<<<<<<<<<<<
 *         cdef double x = xstart, y
 *         cdef size_t i = 0, j
 */
  __pyx_v_dx = __pyx_f_4bpf4_4core__ntodx(__pyx_v_n, __pyx_v_xstart, __pyx_v_xend);

  /* "bpf4/core.pyx":2139
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)
 *         cdef double dx = _ntodx(n, xstart, xend)
 *         cdef double x = xstart, y             # <<<<<<<<<<<<<<
 *         cdef size_t i = 0, j
 *         cdef double outbound1 = self.outbound1
 */
  __pyx_v_x = __pyx_v_xstart;

  /* "bpf4/core.pyx":2140
 *         cdef double dx = _ntodx(n, xstart, xend)
 *         cdef double x = xstart, y
 *         cdef size_t i = 0, j             # <<<<<<<<<<<<<<
 *         cdef double outbound1 = self.outbound1
 *         cdef double outbound0 = self.outbound0
 */
  __pyx_v_i = 0;

  /* "bpf4/core.pyx":2141
 *         cdef double x = xstart, y
 *         cdef size_t i = 0, j
 *         cdef double outbound1 = self.outbound1             # <<<<<<<<<<<<<<
 *         cdef double outbound0 = self.outbound0
 *         cdef DTYPE_t *xs_data = self.xs_data
 */
  __pyx_t_13 = __pyx_v_self->outbound1;
  __pyx_v_outbound1 = __pyx_t_13;

  /* "bpf4/core.pyx":2142
 *         cdef size_t i = 0, j
 *         cdef double outbound1 = self.outbound1
 *         cdef double outbound0 = self.outbound0             # <<<<<<<<<<<<<<
 *         cdef DTYPE_t *xs_data = self.xs_data
 *         cdef DTYPE_t *ys_data = self.ys_data
 */
  __pyx_t_13 = __pyx_v_self->outbound0;
  __pyx_v_outbound0 = __pyx_t_13;

  /* "bpf4/core.pyx":2143
 *         cdef double outbound1 = self.outbound1
 *         cdef double outbound0 = self.outbound0
 *         cdef DTYPE_t *xs_data = self.xs_data             # <<<<<<<<<<<<<<
 *         cdef DTYPE_t *ys_data = self.ys_data
 *         cdef double xs_data0, xs_data1, ys_data0, ys_data1
 */
  __pyx_t_14 = __pyx_v_self->xs_data;
  __pyx_v_xs_data = __pyx_t_14;

  /* "bpf4/core.pyx":2144
 *         cdef double outbound0 = self.outbound0
 *         cdef DTYPE_t *xs_data = self.xs_data
 *         cdef DTYPE_t *ys_data = self.ys_data             # <<<<<<<<<<<<<<
 *         cdef double xs_data0, xs_data1, ys_data0, ys_data1
 *         cdef double x1 = self._x1
 */
  __pyx_t_14 = __pyx_v_self->ys_data;
  __pyx_v_ys_data = __pyx_t_14;

  /* "bpf4/core.pyx":2146
 *         cdef DTYPE_t *ys_data = self.ys_data
 *         cdef double xs_data0, xs_data1, ys_data0, ys_data1
 *         cdef double x1 = self._x1             # <<<<<<<<<<<<<<
 *         cdef int64_t index0 = 0
 *         cdef double interpmix = self.interpol_func.mix
 */
  __pyx_t_13 = __pyx_v_self->__pyx_base._x1;
  __pyx_v_x1 = __pyx_t_13;

  /* "bpf4/core.pyx":2147
 *         cdef double xs_data0, xs_data1, ys_data0, ys_data1
 *         cdef double x1 = self._x1
 *         cdef int64_t index0 = 0             # <<<<<<<<<<<<<<
 *         cdef double interpmix = self.interpol_func.mix
 *         with nogil:
 */
  __pyx_v_index0 = 0;

  /* "bpf4/core.pyx":2148
 *         cdef double x1 = self._x1
 *         cdef int64_t index0 = 0
 *         cdef double interpmix = self.interpol_func.mix             # <<<<<<<<<<<<<<
 *         with nogil:
 *             if xstart < self._x0:
 */
  __pyx_t_13 = __pyx_v_self->interpol_func->mix;
  __pyx_v_interpmix = __pyx_t_13;

  /* "bpf4/core.pyx":2149
 *         cdef int64_t index0 = 0
 *         cdef double interpmix = self.interpol_func.mix
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if xstart < self._x0:
 *                 j = min(n, <int>((self._x0 - xstart) / dx) + 1)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "bpf4/core.pyx":2150
 *         cdef double interpmix = self.interpol_func.mix
 *         with nogil:
 *             if xstart < self._x0:             # <<<<<<<<<<<<<<
 *                 j = min(n, <int>((self._x0 - xstart) / dx) + 1)
 *                 for i in range(j):
 */
        __pyx_t_11 = ((__pyx_v_xstart < __pyx_v_self->__pyx_base._x0) != 0);
        if (__pyx_t_11) {

          /* "bpf4/core.pyx":2151
 *         with nogil:
 *             if xstart < self._x0:
 *                 j = min(n, <int>((self._x0 - xstart) / dx) + 1)             # <<<<<<<<<<<<<<
 *                 for i in range(j):
 *                     result[i] = outbound0
 */
          __pyx_t_13 = (__pyx_v_self->__pyx_base._x0 - __pyx_v_xstart);
          if (unlikely(__pyx_v_dx == 0)) {
            #ifdef WITH_THREAD
            PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
            #endif
            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            __PYX_ERR(0, 2151, __pyx_L4_error)
          }
          __pyx_t_15 = (((int)(__pyx_t_13 / __pyx_v_dx)) + 1);
          __pyx_t_8 = __pyx_v_n;
          if (((__pyx_t_15 < __pyx_t_8) != 0)) {
            __pyx_t_16 = __pyx_t_15;
          } else {
            __pyx_t_16 = __pyx_t_8;
          }
          __pyx_v_j = __pyx_t_16;

          /* "bpf4/core.pyx":2152
 *             if xstart < self._x0:
 *                 j = min(n, <int>((self._x0 - xstart) / dx) + 1)
 *                 for i in range(j):             # <<<<<<<<<<<<<<
 *                     result[i] = outbound0
 *                 i = j
 */
          __pyx_t_17 = __pyx_v_j;
          __pyx_t_18 = __pyx_t_17;
          for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
            __pyx_v_i = __pyx_t_19;

            /* "bpf4/core.pyx":2153
 *                 j = min(n, <int>((self._x0 - xstart) / dx) + 1)
 *                 for i in range(j):
 *                     result[i] = outbound0             # <<<<<<<<<<<<<<
 *                 i = j
 *             x = xstart + i*dx
 */
            __pyx_t_20 = __pyx_v_i;
            *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_result.data) + __pyx_t_20)) )) = __pyx_v_outbound0;
          }

          /* "bpf4/core.pyx":2154
 *                 for i in range(j):
 *                     result[i] = outbound0
 *                 i = j             # <<<<<<<<<<<<<<
 *             x = xstart + i*dx
 *             if self._x0 <= x <= self._x1:
 */
          __pyx_v_i = __pyx_v_j;

          /* "bpf4/core.pyx":2150
 *         cdef double interpmix = self.interpol_func.mix
 *         with nogil:
 *             if xstart < self._x0:             # <<<<<<<<<<<<<<
 *                 j = min(n, <int>((self._x0 - xstart) / dx) + 1)
 *                 for i in range(j):
 */
        }

        /* "bpf4/core.pyx":2155
 *                     result[i] = outbound0
 *                 i = j
 *             x = xstart + i*dx             # <<<<<<<<<<<<<<
 *             if self._x0 <= x <= self._x1:
 *                 index0 = _csearchsorted(self.xs_data, self.xs_size, x) - 1
 */
        __pyx_v_x = (__pyx_v_xstart + (__pyx_v_i * __pyx_v_dx));

        /* "bpf4/core.pyx":2156
 *                 i = j
 *             x = xstart + i*dx
 *             if self._x0 <= x <= self._x1:             # <<<<<<<<<<<<<<
 *                 index0 = _csearchsorted(self.xs_data, self.xs_size, x) - 1
 *             elif x > self._x1:
 */
        __pyx_t_11 = (__pyx_v_self->__pyx_base._x0 <= __pyx_v_x);
        if (__pyx_t_11) {
          __pyx_t_11 = (__pyx_v_x <= __pyx_v_self->__pyx_base._x1);
        }
        __pyx_t_21 = (__pyx_t_11 != 0);
        if (__pyx_t_21) {

          /* "bpf4/core.pyx":2157
 *             x = xstart + i*dx
 *             if self._x0 <= x <= self._x1:
 *                 index0 = _csearchsorted(self.xs_data, self.xs_size, x) - 1             # <<<<<<<<<<<<<<
 *             elif x > self._x1:
 *                 for j in range(i, n):
 */
          __pyx_v_index0 = (__pyx_f_4bpf4_4core__csearchsorted(__pyx_v_self->xs_data, __pyx_v_self->xs_size, __pyx_v_x) - 1);

          /* "bpf4/core.pyx":2156
 *                 i = j
 *             x = xstart + i*dx
 *             if self._x0 <= x <= self._x1:             # <<<<<<<<<<<<<<
 *                 index0 = _csearchsorted(self.xs_data, self.xs_size, x) - 1
 *             elif x > self._x1:
 */
          goto __pyx_L9;
        }

        /* "bpf4/core.pyx":2158
 *             if self._x0 <= x <= self._x1:
 *                 index0 = _csearchsorted(self.xs_data, self.xs_size, x) - 1
 *             elif x > self._x1:             # <<<<<<<<<<<<<<
 *                 for j in range(i, n):
 *                     result[j] = outbound1
 */
        __pyx_t_21 = ((__pyx_v_x > __pyx_v_self->__pyx_base._x1) != 0);
        if (__pyx_t_21) {

          /* "bpf4/core.pyx":2159
 *                 index0 = _csearchsorted(self.xs_data, self.xs_size, x) - 1
 *             elif x > self._x1:
 *                 for j in range(i, n):             # <<<<<<<<<<<<<<
 *                     result[j] = outbound1
 *                 i = n
 */
          __pyx_t_8 = __pyx_v_n;
          __pyx_t_22 = __pyx_t_8;
          for (__pyx_t_17 = __pyx_v_i; __pyx_t_17 < __pyx_t_22; __pyx_t_17+=1) {
            __pyx_v_j = __pyx_t_17;

            /* "bpf4/core.pyx":2160
 *             elif x > self._x1:
 *                 for j in range(i, n):
 *                     result[j] = outbound1             # <<<<<<<<<<<<<<
 *                 i = n
 * 
 */
            __pyx_t_18 = __pyx_v_j;
            *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_result.data) + __pyx_t_18)) )) = __pyx_v_outbound1;
          }

          /* "bpf4/core.pyx":2161
 *                 for j in range(i, n):
 *                     result[j] = outbound1
 *                 i = n             # <<<<<<<<<<<<<<
 * 
 *             xs_data0 = xs_data[index0]
 */
          __pyx_v_i = __pyx_v_n;

          /* "bpf4/core.pyx":2158
 *             if self._x0 <= x <= self._x1:
 *                 index0 = _csearchsorted(self.xs_data, self.xs_size, x) - 1
 *             elif x > self._x1:             # <<<<<<<<<<<<<<
 *                 for j in range(i, n):
 *                     result[j] = outbound1
 */
        }
        __pyx_L9:;

        /* "bpf4/core.pyx":2163
 *                 i = n
 * 
 *             xs_data0 = xs_data[index0]             # <<<<<<<<<<<<<<
 *             xs_data1 = xs_data[index0+1]
 *             ys_data0 = ys_data[index0]
 */
        __pyx_v_xs_data0 = (__pyx_v_xs_data[__pyx_v_index0]);

        /* "bpf4/core.pyx":2164
 * 
 *             xs_data0 = xs_data[index0]
 *             xs_data1 = xs_data[index0+1]             # <<<<<<<<<<<<<<
 *             ys_data0 = ys_data[index0]
 *             ys_data1 = ys_data[index0+1]
 */
        __pyx_v_xs_data1 = (__pyx_v_xs_data[(__pyx_v_index0 + 1)]);

        /* "bpf4/core.pyx":2165
 *             xs_data0 = xs_data[index0]
 *             xs_data1 = xs_data[index0+1]
 *             ys_data0 = ys_data[index0]             # <<<<<<<<<<<<<<
 *             ys_data1 = ys_data[index0+1]
 *             while x <= x1 and i < n:
 */
        __pyx_v_ys_data0 = (__pyx_v_ys_data[__pyx_v_index0]);

        /* "bpf4/core.pyx":2166
 *             xs_data1 = xs_data[index0+1]
 *             ys_data0 = ys_data[index0]
 *             ys_data1 = ys_data[index0+1]             # <<<<<<<<<<<<<<
 *             while x <= x1 and i < n:
 *                 if x > xs_data1:
 */
        __pyx_v_ys_data1 = (__pyx_v_ys_data[(__pyx_v_index0 + 1)]);

        /* "bpf4/core.pyx":2167
 *             ys_data0 = ys_data[index0]
 *             ys_data1 = ys_data[index0+1]
 *             while x <= x1 and i < n:             # <<<<<<<<<<<<<<
 *                 if x > xs_data1:
 *                     index0 = _csearchlinear(xs_data, self.xs_size, x, index0)
 */
        while (1) {
          __pyx_t_11 = ((__pyx_v_x <= __pyx_v_x1) != 0);
          if (__pyx_t_11) {
          } else {
            __pyx_t_21 = __pyx_t_11;
            goto __pyx_L14_bool_binop_done;
          }
          __pyx_t_11 = ((__pyx_v_i < __pyx_v_n) != 0);
          __pyx_t_21 = __pyx_t_11;
          __pyx_L14_bool_binop_done:;
          if (!__pyx_t_21) break;

          /* "bpf4/core.pyx":2168
 *             ys_data1 = ys_data[index0+1]
 *             while x <= x1 and i < n:
 *                 if x > xs_data1:             # <<<<<<<<<<<<<<
 *                     index0 = _csearchlinear(xs_data, self.xs_size, x, index0)
 *                     xs_data0 = xs_data[index0]
 */
          __pyx_t_21 = ((__pyx_v_x > __pyx_v_xs_data1) != 0);
          if (__pyx_t_21) {

            /* "bpf4/core.pyx":2169
 *             while x <= x1 and i < n:
 *                 if x > xs_data1:
 *                     index0 = _csearchlinear(xs_data, self.xs_size, x, index0)             # <<<<<<<<<<<<<<
 *                     xs_data0 = xs_data[index0]
 *                     xs_data1 = xs_data[index0+1]
 */
            __pyx_v_index0 = __pyx_f_4bpf4_4core__csearchlinear(__pyx_v_xs_data, __pyx_v_self->xs_size, __pyx_v_x, __pyx_v_index0);

            /* "bpf4/core.pyx":2170
 *                 if x > xs_data1:
 *                     index0 = _csearchlinear(xs_data, self.xs_size, x, index0)
 *                     xs_data0 = xs_data[index0]             # <<<<<<<<<<<<<<
 *                     xs_data1 = xs_data[index0+1]
 *                     ys_data0 = ys_data[index0]
 */
            __pyx_v_xs_data0 = (__pyx_v_xs_data[__pyx_v_index0]);

            /* "bpf4/core.pyx":2171
 *                     index0 = _csearchlinear(xs_data, self.xs_size, x, index0)
 *                     xs_data0 = xs_data[index0]
 *                     xs_data1 = xs_data[index0+1]             # <<<<<<<<<<<<<<
 *                     ys_data0 = ys_data[index0]
 *                     ys_data1 = ys_data[index0+1]
 */
            __pyx_v_xs_data1 = (__pyx_v_xs_data[(__pyx_v_index0 + 1)]);

            /* "bpf4/core.pyx":2172
 *                     xs_data0 = xs_data[index0]
 *                     xs_data1 = xs_data[index0+1]
 *                     ys_data0 = ys_data[index0]             # <<<<<<<<<<<<<<
 *                     ys_data1 = ys_data[index0+1]
 * 
 */
            __pyx_v_ys_data0 = (__pyx_v_ys_data[__pyx_v_index0]);

            /* "bpf4/core.pyx":2173
 *                     xs_data1 = xs_data[index0+1]
 *                     ys_data0 = ys_data[index0]
 *                     ys_data1 = ys_data[index0+1]             # <<<<<<<<<<<<<<
 * 
 *                 result[i] = InterpolFunc_call(self.interpol_func, x, xs_data0, ys_data0, xs_data1, ys_data1)
 */
            __pyx_v_ys_data1 = (__pyx_v_ys_data[(__pyx_v_index0 + 1)]);

            /* "bpf4/core.pyx":2168
 *             ys_data1 = ys_data[index0+1]
 *             while x <= x1 and i < n:
 *                 if x > xs_data1:             # <<<<<<<<<<<<<<
 *                     index0 = _csearchlinear(xs_data, self.xs_size, x, index0)
 *                     xs_data0 = xs_data[index0]
 */
          }

          /* "bpf4/core.pyx":2175
 *                     ys_data1 = ys_data[index0+1]
 * 
 *                 result[i] = InterpolFunc_call(self.interpol_func, x, xs_data0, ys_data0, xs_data1, ys_data1)             # <<<<<<<<<<<<<<
 *                 i += 1
 *                 x = xstart + i*dx
 */
          __pyx_t_17 = __pyx_v_i;
          *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_result.data) + __pyx_t_17)) )) = __pyx_f_4bpf4_4core_InterpolFunc_call(__pyx_v_self->interpol_func, __pyx_v_x, __pyx_v_xs_data0, __pyx_v_ys_data0, __pyx_v_xs_data1, __pyx_v_ys_data1);

          /* "bpf4/core.pyx":2176
 * 
 *                 result[i] = InterpolFunc_call(self.interpol_func, x, xs_data0, ys_data0, xs_data1, ys_data1)
 *                 i += 1             # <<<<<<<<<<<<<<
 *                 x = xstart + i*dx
 *             if i < n - 1:
 */
          __pyx_v_i = (__pyx_v_i + 1);

          /* "bpf4/core.pyx":2177
 *                 result[i] = InterpolFunc_call(self.interpol_func, x, xs_data0, ys_data0, xs_data1, ys_data1)
 *                 i += 1
 *                 x = xstart + i*dx             # <<<<<<<<<<<<<<
 *             if i < n - 1:
 *                 for j in range(i, n):
 */
          __pyx_v_x = (__pyx_v_xstart + (__pyx_v_i * __pyx_v_dx));
        }

        /* "bpf4/core.pyx":2178
 *                 i += 1
 *                 x = xstart + i*dx
 *             if i < n - 1:             # <<<<<<<<<<<<<<
 *                 for j in range(i, n):
 *                     result[j] = outbound1
 */
        __pyx_t_21 = ((__pyx_v_i < (__pyx_v_n - 1)) != 0);
        if (__pyx_t_21) {

          /* "bpf4/core.pyx":2179
 *                 x = xstart + i*dx
 *             if i < n - 1:
 *                 for j in range(i, n):             # <<<<<<<<<<<<<<
 *                     result[j] = outbound1
 *         return numpy.asarray(result)
 */
          __pyx_t_8 = __pyx_v_n;
          __pyx_t_22 = __pyx_t_8;
          for (__pyx_t_17 = __pyx_v_i; __pyx_t_17 < __pyx_t_22; __pyx_t_17+=1) {
            __pyx_v_j = __pyx_t_17;

            /* "bpf4/core.pyx":2180
 *             if i < n - 1:
 *                 for j in range(i, n):
 *                     result[j] = outbound1             # <<<<<<<<<<<<<<
 *         return numpy.asarray(result)
 * 
 */
            __pyx_t_18 = __pyx_v_j;
            *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_result.data) + __pyx_t_18)) )) = __pyx_v_outbound1;
          }

          /* "bpf4/core.pyx":2178
 *                 i += 1
 *                 x = xstart + i*dx
 *             if i < n - 1:             # <<<<<<<<<<<<<<
 *                 for j in range(i, n):
 *                     result[j] = outbound1
 */
        }
      }

      /* "bpf4/core.pyx":2149
 *         cdef int64_t index0 = 0
 *         cdef double interpmix = self.interpol_func.mix
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if xstart < self._x0:
 *                 j = min(n, <int>((self._x0 - xstart) / dx) + 1)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "bpf4/core.pyx":2181
 *                 for j in range(i, n):
 *                     result[j] = outbound1
 *         return numpy.asarray(result)             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray _mapn_between(self, int n, double xstart, double xend, ndarray out=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_result, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2181, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2136
 *         return res
 * 
 *     cpdef ndarray mapn_between(self, int n, double xstart, double xend, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)
 *         cdef double dx = _ntodx(n, xstart, xend)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_AddTraceback("bpf4.core.BpfBase.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_13mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_12mapn_between[] = "BpfBase.mapn_between(self, int n, double xstart, double xend, ndarray out=None) -> ndarray";
static PyMethodDef __pyx_mdef_4bpf4_4core_7BpfBase_13mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7BpfBase_13mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7BpfBase_12mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_13mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_xstart;
  double __pyx_v_xend;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_xstart,&__pyx_n_s_xend,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xstart)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 2136, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xend)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 2136, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 2136, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2136, __pyx_L3_error)
    __pyx_v_xstart = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_xstart == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2136, __pyx_L3_error)
    __pyx_v_xend = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xend == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2136, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2136, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfBase.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 2136, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_12mapn_between(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self), __pyx_v_n, __pyx_v_xstart, __pyx_v_xend, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_12mapn_between(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, int __pyx_v_n, double __pyx_v_xstart, double __pyx_v_xend, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_BpfBase->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_xstart, __pyx_v_xend, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfBase.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2183
 *         return numpy.asarray(result)
 * 
 *     cpdef ndarray _mapn_between(self, int n, double xstart, double xend, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */

static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_15_mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_7BpfBase__mapn_between(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, int __pyx_v_n, double __pyx_v_xstart, double __pyx_v_xend, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7BpfBase__mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  __Pyx_memviewslice __pyx_v_result = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_dx;
  int __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_11;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_t_13;
  long __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_7BpfBase_15_mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_xstart); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_xend); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2183, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2183, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2183, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2183, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2183, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":2199
 *             is `(xend-xstart)/n`
 *         """
 *         cdef double[:] result = out if out is not None else EMPTY1D(n)             # <<<<<<<<<<<<<<
 *         cdef double dx = (xend - xstart) / (n - 1)   # we account for the edge (x1 IS INCLUDED)
 *         with nogil:
 */
  __pyx_t_11 = (((PyObject *)__pyx_v_out) != Py_None);
  if ((__pyx_t_11 != 0)) {
    __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(((PyObject *)__pyx_v_out), PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 2199, __pyx_L1_error)
    __pyx_t_10 = __pyx_t_12;
    __pyx_t_12.memview = NULL;
    __pyx_t_12.data = NULL;
  } else {
    __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 2199, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_t_12;
    __pyx_t_12.memview = NULL;
    __pyx_t_12.data = NULL;
  }
  __pyx_v_result = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "bpf4/core.pyx":2200
 *         """
 *         cdef double[:] result = out if out is not None else EMPTY1D(n)
 *         cdef double dx = (xend - xstart) / (n - 1)   # we account for the edge (x1 IS INCLUDED)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             for i in range(n):
 */
  __pyx_t_13 = (__pyx_v_xend - __pyx_v_xstart);
  __pyx_t_14 = (__pyx_v_n - 1);
  if (unlikely(__pyx_t_14 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 2200, __pyx_L1_error)
  }
  __pyx_v_dx = (__pyx_t_13 / ((double)__pyx_t_14));

  /* "bpf4/core.pyx":2201
 *         cdef double[:] result = out if out is not None else EMPTY1D(n)
 *         cdef double dx = (xend - xstart) / (n - 1)   # we account for the edge (x1 IS INCLUDED)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for i in range(n):
 *                 result[i] = self.__ccall__(xstart + dx*i)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "bpf4/core.pyx":2202
 *         cdef double dx = (xend - xstart) / (n - 1)   # we account for the edge (x1 IS INCLUDED)
 *         with nogil:
 *             for i in range(n):             # <<<<<<<<<<<<<<
 *                 result[i] = self.__ccall__(xstart + dx*i)
 *         return numpy.asarray(result)
 */
        __pyx_t_8 = __pyx_v_n;
        __pyx_t_15 = __pyx_t_8;
        for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
          __pyx_v_i = __pyx_t_16;

          /* "bpf4/core.pyx":2203
 *         with nogil:
 *             for i in range(n):
 *                 result[i] = self.__ccall__(xstart + dx*i)             # <<<<<<<<<<<<<<
 *         return numpy.asarray(result)
 * 
 */
          __pyx_t_17 = __pyx_v_i;
          *((double *) ( /* dim=0 */ (__pyx_v_result.data + __pyx_t_17 * __pyx_v_result.strides[0]) )) = ((struct __pyx_vtabstruct_4bpf4_4core_BpfBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___ccall__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), (__pyx_v_xstart + (__pyx_v_dx * __pyx_v_i)));
        }
      }

      /* "bpf4/core.pyx":2201
 *         cdef double[:] result = out if out is not None else EMPTY1D(n)
 *         cdef double dx = (xend - xstart) / (n - 1)   # we account for the edge (x1 IS INCLUDED)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for i in range(n):
 *                 result[i] = self.__ccall__(xstart + dx*i)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "bpf4/core.pyx":2204
 *             for i in range(n):
 *                 result[i] = self.__ccall__(xstart + dx*i)
 *         return numpy.asarray(result)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_result, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2204, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2183
 *         return numpy.asarray(result)
 * 
 *     cpdef ndarray _mapn_between(self, int n, double xstart, double xend, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_AddTraceback("bpf4.core.BpfBase._mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_15_mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_14_mapn_between[] = "BpfBase._mapn_between(self, int n, double xstart, double xend, ndarray out=None) -> ndarray\n\n        Return an array of `n` elements resulting of evaluating this bpf regularly\n\n        The x coordinates at which this bpf is evaluated are equivalent to `linspace(xstart, xend, n)`\n\n        Args:\n            n (int): the number of elements to generate\n            xstart (float): x to start mapping\n            xend (float): x to end mapping\n            out (ndarray): if given, result is put here\n\n        Returns:\n            (ndarray) An array of this bpf evaluated at a grid [xstart:xend:dx], where *dx*\n            is `(xend-xstart)/n`\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7BpfBase_15_mapn_between = {"_mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7BpfBase_15_mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7BpfBase_14_mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_15_mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_xstart;
  double __pyx_v_xend;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_xstart,&__pyx_n_s_xend,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xstart)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 2183, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xend)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 2183, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mapn_between") < 0)) __PYX_ERR(0, 2183, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L3_error)
    __pyx_v_xstart = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_xstart == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L3_error)
    __pyx_v_xend = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xend == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2183, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfBase._mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 2183, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_14_mapn_between(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self), __pyx_v_n, __pyx_v_xstart, __pyx_v_xend, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_14_mapn_between(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, int __pyx_v_n, double __pyx_v_xstart, double __pyx_v_xend, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_7BpfBase__mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_BpfBase->_mapn_between(__pyx_v_self, __pyx_v_n, __pyx_v_xstart, __pyx_v_xend, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfBase._mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2206
 *         return numpy.asarray(result)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(self._x0), str(self._x1))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_17__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_17__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_16__repr__(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_16__repr__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "bpf4/core.pyx":2207
 * 
 *     def __repr__(self):
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(self._x0), str(self._x1))             # <<<<<<<<<<<<<<
 * 
 *     def stretch(self, double rx):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__21);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__21);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__21);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__22);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__22);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__22);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__23);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__23);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u__23);
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 6, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2206
 *         return numpy.asarray(result)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(self._x0), str(self._x1))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.BpfBase.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2209
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(self._x0), str(self._x1))
 * 
 *     def stretch(self, double rx):             # <<<<<<<<<<<<<<
 *         """
 *         Stretch or compress this bpf in the x-coordinate **INPLACE**
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_19stretch(PyObject *__pyx_v_self, PyObject *__pyx_arg_rx); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_18stretch[] = "BpfBase.stretch(self, double rx)\n\n        Stretch or compress this bpf in the x-coordinate **INPLACE**\n\n        **NB**: use `stretched` to create a new bpf\n\n        Args:\n            rx (float): the stretch/compression factor\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7BpfBase_19stretch = {"stretch", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_19stretch, METH_O, __pyx_doc_4bpf4_4core_7BpfBase_18stretch};
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_19stretch(PyObject *__pyx_v_self, PyObject *__pyx_arg_rx) {
  double __pyx_v_rx;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stretch (wrapper)", 0);
  assert(__pyx_arg_rx); {
    __pyx_v_rx = __pyx_PyFloat_AsDouble(__pyx_arg_rx); if (unlikely((__pyx_v_rx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2209, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfBase.stretch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_18stretch(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self), ((double)__pyx_v_rx));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_18stretch(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, double __pyx_v_rx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stretch", 0);

  /* "bpf4/core.pyx":2219
 * 
 *         """
 *         if rx == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("the stretch factor cannot be 0")
 *         self.xs *= rx
 */
  __pyx_t_1 = ((__pyx_v_rx == 0.0) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "bpf4/core.pyx":2220
 *         """
 *         if rx == 0:
 *             raise ValueError("the stretch factor cannot be 0")             # <<<<<<<<<<<<<<
 *         self.xs *= rx
 *         self._recalculate_bounds()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2220, __pyx_L1_error)

    /* "bpf4/core.pyx":2219
 * 
 *         """
 *         if rx == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("the stretch factor cannot be 0")
 *         self.xs *= rx
 */
  }

  /* "bpf4/core.pyx":2221
 *         if rx == 0:
 *             raise ValueError("the stretch factor cannot be 0")
 *         self.xs *= rx             # <<<<<<<<<<<<<<
 *         self._recalculate_bounds()
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_rx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_self->xs), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2221, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->xs);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->xs));
  __pyx_v_self->xs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "bpf4/core.pyx":2222
 *             raise ValueError("the stretch factor cannot be 0")
 *         self.xs *= rx
 *         self._recalculate_bounds()             # <<<<<<<<<<<<<<
 * 
 *     def shift(self, double dx):
 */
  ((struct __pyx_vtabstruct_4bpf4_4core_BpfBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->_recalculate_bounds(__pyx_v_self);

  /* "bpf4/core.pyx":2209
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(self._x0), str(self._x1))
 * 
 *     def stretch(self, double rx):             # <<<<<<<<<<<<<<
 *         """
 *         Stretch or compress this bpf in the x-coordinate **INPLACE**
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.BpfBase.stretch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2224
 *         self._recalculate_bounds()
 * 
 *     def shift(self, double dx):             # <<<<<<<<<<<<<<
 *         """
 *         Shift the bpf along the x-coords, **INPLACE**
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_21shift(PyObject *__pyx_v_self, PyObject *__pyx_arg_dx); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_20shift[] = "BpfBase.shift(self, double dx)\n\n        Shift the bpf along the x-coords, **INPLACE**\n        \n        Use [.shifted](#shifted) to create a new bpf\n\n        Args:\n            dx (float): the shift interval\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7BpfBase_21shift = {"shift", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_21shift, METH_O, __pyx_doc_4bpf4_4core_7BpfBase_20shift};
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_21shift(PyObject *__pyx_v_self, PyObject *__pyx_arg_dx) {
  double __pyx_v_dx;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shift (wrapper)", 0);
  assert(__pyx_arg_dx); {
    __pyx_v_dx = __pyx_PyFloat_AsDouble(__pyx_arg_dx); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2224, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfBase.shift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_20shift(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self), ((double)__pyx_v_dx));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_20shift(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, double __pyx_v_dx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shift", 0);

  /* "bpf4/core.pyx":2234
 * 
 *         """
 *         self.xs += dx             # <<<<<<<<<<<<<<
 *         self._recalculate_bounds()
 * 
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_self->xs), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->xs);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->xs));
  __pyx_v_self->xs = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":2235
 *         """
 *         self.xs += dx
 *         self._recalculate_bounds()             # <<<<<<<<<<<<<<
 * 
 *     cdef void _recalculate_bounds(self):
 */
  ((struct __pyx_vtabstruct_4bpf4_4core_BpfBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->_recalculate_bounds(__pyx_v_self);

  /* "bpf4/core.pyx":2224
 *         self._recalculate_bounds()
 * 
 *     def shift(self, double dx):             # <<<<<<<<<<<<<<
 *         """
 *         Shift the bpf along the x-coords, **INPLACE**
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core.BpfBase.shift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2237
 *         self._recalculate_bounds()
 * 
 *     cdef void _recalculate_bounds(self):             # <<<<<<<<<<<<<<
 *         cdef DTYPE_t* data
 *         cdef int nx
 */

static void __pyx_f_4bpf4_4core_7BpfBase__recalculate_bounds(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self) {
  int __pyx_v_nx;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_recalculate_bounds", 0);

  /* "bpf4/core.pyx":2240
 *         cdef DTYPE_t* data
 *         cdef int nx
 *         nx = PyArray_DIM(self.xs, 0)             # <<<<<<<<<<<<<<
 *         self.xs_data = <DTYPE_t*>self.xs.data
 *         self._x0 = self.xs_data[0]
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->xs);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_nx = PyArray_DIM(((PyArrayObject *)__pyx_t_1), 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2241
 *         cdef int nx
 *         nx = PyArray_DIM(self.xs, 0)
 *         self.xs_data = <DTYPE_t*>self.xs.data             # <<<<<<<<<<<<<<
 *         self._x0 = self.xs_data[0]
 *         self._x1 = self.xs_data[nx - 1]
 */
  __pyx_v_self->xs_data = ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_self->xs->data);

  /* "bpf4/core.pyx":2242
 *         nx = PyArray_DIM(self.xs, 0)
 *         self.xs_data = <DTYPE_t*>self.xs.data
 *         self._x0 = self.xs_data[0]             # <<<<<<<<<<<<<<
 *         self._x1 = self.xs_data[nx - 1]
 *         self._invalidate_cache()
 */
  __pyx_v_self->__pyx_base._x0 = (__pyx_v_self->xs_data[0]);

  /* "bpf4/core.pyx":2243
 *         self.xs_data = <DTYPE_t*>self.xs.data
 *         self._x0 = self.xs_data[0]
 *         self._x1 = self.xs_data[nx - 1]             # <<<<<<<<<<<<<<
 *         self._invalidate_cache()
 * 
 */
  __pyx_v_self->__pyx_base._x1 = (__pyx_v_self->xs_data[(__pyx_v_nx - 1)]);

  /* "bpf4/core.pyx":2244
 *         self._x0 = self.xs_data[0]
 *         self._x1 = self.xs_data[nx - 1]
 *         self._invalidate_cache()             # <<<<<<<<<<<<<<
 * 
 *     def points(BpfBase self):
 */
  ((struct __pyx_vtabstruct_4bpf4_4core_BpfBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->_invalidate_cache(__pyx_v_self);

  /* "bpf4/core.pyx":2237
 *         self._recalculate_bounds()
 * 
 *     cdef void _recalculate_bounds(self):             # <<<<<<<<<<<<<<
 *         cdef DTYPE_t* data
 *         cdef int nx
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":2246
 *         self._invalidate_cache()
 * 
 *     def points(BpfBase self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple with the points defining this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_23points(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_22points[] = "BpfBase.points(self)\n\n        Returns a tuple with the points defining this bpf\n\n        Returns:\n            (tuple[ndarray, ndarray]) a tuple (xs, ys) where `xs` is an array\n            holding the values for the *x* coordinate, and `ys` holds the values for\n            the *y* coordinate\n\n        ## Example\n        \n        ```python\n\n        >>> b = Linear.fromseq(0, 0, 1, 100, 2, 50)\n        >>> b.points()\n        ([0, 1, 2], [0, 100, 50])\n        ```\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7BpfBase_23points = {"points", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_23points, METH_NOARGS, __pyx_doc_4bpf4_4core_7BpfBase_22points};
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_23points(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("points (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_22points(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_22points(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("points", 0);

  /* "bpf4/core.pyx":2265
 * 
 *         """
 *         return self.xs, self.ys             # <<<<<<<<<<<<<<
 * 
 *     def clone_with_new_data(self, xs: ndarray, ys: ndarray) -> BpfInterface:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->xs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->xs));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->xs));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->ys));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->ys));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2246
 *         self._invalidate_cache()
 * 
 *     def points(BpfBase self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple with the points defining this bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfBase.points", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2267
 *         return self.xs, self.ys
 * 
 *     def clone_with_new_data(self, xs: ndarray, ys: ndarray) -> BpfInterface:             # <<<<<<<<<<<<<<
 *         """
 *         Create a new bpf with the same attributes as self but with new data
 */

/* Python wrapper */
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_pw_4bpf4_4core_7BpfBase_25clone_with_new_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_24clone_with_new_data[] = "BpfBase.clone_with_new_data(self, ndarray xs: ndarray, ndarray ys: ndarray) -> BpfInterface\n\n        Create a new bpf with the same attributes as self but with new data\n\n        Args:\n            xs (ndarray): the x-coord data\n            ys (ndarray): the y-coord data\n\n        Returns:\n            (BpfInterface) The new bpf. It will be of the same class as self\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7BpfBase_25clone_with_new_data = {"clone_with_new_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7BpfBase_25clone_with_new_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7BpfBase_24clone_with_new_data};
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_pw_4bpf4_4core_7BpfBase_25clone_with_new_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_xs = 0;
  PyArrayObject *__pyx_v_ys = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clone_with_new_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("clone_with_new_data", 1, 2, 2, 1); __PYX_ERR(0, 2267, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clone_with_new_data") < 0)) __PYX_ERR(0, 2267, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_xs = ((PyArrayObject *)values[0]);
    __pyx_v_ys = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clone_with_new_data", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2267, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfBase.clone_with_new_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xs), __pyx_ptype_5numpy_ndarray, 1, "xs", 0))) __PYX_ERR(0, 2267, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ys), __pyx_ptype_5numpy_ndarray, 1, "ys", 0))) __PYX_ERR(0, 2267, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_24clone_with_new_data(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_pf_4bpf4_4core_7BpfBase_24clone_with_new_data(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, PyArrayObject *__pyx_v_xs, PyArrayObject *__pyx_v_ys) {
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_v_newstate = NULL;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clone_with_new_data", 0);

  /* "bpf4/core.pyx":2279
 * 
 *         """
 *         state = self.__getstate__()             # <<<<<<<<<<<<<<
 *         newstate = (xs, ys) + state[2:]
 *         return self.__class__(*newstate)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2280
 *         """
 *         state = self.__getstate__()
 *         newstate = (xs, ys) + state[2:]             # <<<<<<<<<<<<<<
 *         return self.__class__(*newstate)
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_xs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_xs));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_xs));
  __Pyx_INCREF(((PyObject *)__pyx_v_ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_ys));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_ys));
  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_state, 2, 0, NULL, NULL, &__pyx_slice__25, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2280, __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;
  __pyx_v_newstate = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bpf4/core.pyx":2281
 *         state = self.__getstate__()
 *         newstate = (xs, ys) + state[2:]
 *         return self.__class__(*newstate)             # <<<<<<<<<<<<<<
 * 
 *     def insertpoint(self, double x, double y):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_newstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 2281, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2267
 *         return self.xs, self.ys
 * 
 *     def clone_with_new_data(self, xs: ndarray, ys: ndarray) -> BpfInterface:             # <<<<<<<<<<<<<<
 *         """
 *         Create a new bpf with the same attributes as self but with new data
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.BpfBase.clone_with_new_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v_newstate);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2283
 *         return self.__class__(*newstate)
 * 
 *     def insertpoint(self, double x, double y):             # <<<<<<<<<<<<<<
 *         """
 *         Return **a copy** of this bpf with the point `(x, y)` inserted
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_27insertpoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_26insertpoint[] = "BpfBase.insertpoint(self, double x, double y)\n\n        Return **a copy** of this bpf with the point `(x, y)` inserted\n\n        !!! note\n\n            *self* is not modified\n\n        Args:\n            x (float): x coord\n            y (float): y coord\n\n        Returns:\n            (BpfInterface) A clone of this bpf with the point inserted\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7BpfBase_27insertpoint = {"insertpoint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7BpfBase_27insertpoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7BpfBase_26insertpoint};
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_27insertpoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x;
  double __pyx_v_y;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insertpoint (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insertpoint", 1, 2, 2, 1); __PYX_ERR(0, 2283, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insertpoint") < 0)) __PYX_ERR(0, 2283, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2283, __pyx_L3_error)
    __pyx_v_y = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_y == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2283, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insertpoint", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2283, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfBase.insertpoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_26insertpoint(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_26insertpoint(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, double __pyx_v_x, double __pyx_v_y) {
  int __pyx_v_index;
  PyObject *__pyx_v_new_xs = NULL;
  PyObject *__pyx_v_new_ys = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("insertpoint", 0);

  /* "bpf4/core.pyx":2298
 *             (BpfInterface) A clone of this bpf with the point inserted
 *         """
 *         cdef int index = _searchsorted(self.xs, x)             # <<<<<<<<<<<<<<
 *         new_xs = numpy.insert(self.xs, index, x)
 *         new_ys = numpy.insert(self.ys, index, y)
 */
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(((PyObject *)__pyx_v_self->xs), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 2298, __pyx_L1_error)
  __pyx_v_index = __pyx_f_4bpf4_4core__searchsorted(__pyx_t_1, __pyx_v_x);
  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;

  /* "bpf4/core.pyx":2299
 *         """
 *         cdef int index = _searchsorted(self.xs, x)
 *         new_xs = numpy.insert(self.xs, index, x)             # <<<<<<<<<<<<<<
 *         new_ys = numpy.insert(self.ys, index, y)
 *         return self.clone_with_new_data(new_xs, new_ys)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_insert); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, ((PyObject *)__pyx_v_self->xs), __pyx_t_3, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2299, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, ((PyObject *)__pyx_v_self->xs), __pyx_t_3, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2299, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self->xs));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->xs));
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_self->xs));
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_new_xs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":2300
 *         cdef int index = _searchsorted(self.xs, x)
 *         new_xs = numpy.insert(self.xs, index, x)
 *         new_ys = numpy.insert(self.ys, index, y)             # <<<<<<<<<<<<<<
 *         return self.clone_with_new_data(new_xs, new_ys)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_insert); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self->ys), __pyx_t_4, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2300, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self->ys), __pyx_t_4, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2300, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self->ys));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->ys));
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, ((PyObject *)__pyx_v_self->ys));
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_new_ys = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":2301
 *         new_xs = numpy.insert(self.xs, index, x)
 *         new_ys = numpy.insert(self.ys, index, y)
 *         return self.clone_with_new_data(new_xs, new_ys)             # <<<<<<<<<<<<<<
 * 
 *     def removepoint(self, double x):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clone_with_new_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_new_xs, __pyx_v_new_ys};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2301, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_new_xs, __pyx_v_new_ys};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2301, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_new_xs);
    __Pyx_GIVEREF(__pyx_v_new_xs);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_new_xs);
    __Pyx_INCREF(__pyx_v_new_ys);
    __Pyx_GIVEREF(__pyx_v_new_ys);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_new_ys);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2283
 *         return self.__class__(*newstate)
 * 
 *     def insertpoint(self, double x, double y):             # <<<<<<<<<<<<<<
 *         """
 *         Return **a copy** of this bpf with the point `(x, y)` inserted
 */

  /* function exit code */
  __pyx_L1_error:;
  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bpf4.core.BpfBase.insertpoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_new_xs);
  __Pyx_XDECREF(__pyx_v_new_ys);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2303
 *         return self.clone_with_new_data(new_xs, new_ys)
 * 
 *     def removepoint(self, double x):             # <<<<<<<<<<<<<<
 *         """
 *         Return a copy of this bpf with point at x removed
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_29removepoint(PyObject *__pyx_v_self, PyObject *__pyx_arg_x); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_28removepoint[] = "BpfBase.removepoint(self, double x)\n\n        Return a copy of this bpf with point at x removed\n\n        Args:\n            x (float): the x point to remove\n\n        Returns:\n            (BpfInterface) A copy of this bpf with the given point removed\n        \n        Raises `ValueError` if x is not in this bpf\n        \n        To remove elements by index, do:\n\n        ```python\n\n        xs, ys = mybpf.points()\n        xs = numpy.delete(xs, indices)\n        ys = numpy.delete(ys, indices)\n        mybpf = mybpf.clone_with_new_data(xs, ys)\n\n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7BpfBase_29removepoint = {"removepoint", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_29removepoint, METH_O, __pyx_doc_4bpf4_4core_7BpfBase_28removepoint};
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_29removepoint(PyObject *__pyx_v_self, PyObject *__pyx_arg_x) {
  double __pyx_v_x;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("removepoint (wrapper)", 0);
  assert(__pyx_arg_x); {
    __pyx_v_x = __pyx_PyFloat_AsDouble(__pyx_arg_x); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2303, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.BpfBase.removepoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_28removepoint(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self), ((double)__pyx_v_x));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_28removepoint(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self, double __pyx_v_x) {
  int __pyx_v_index;
  PyObject *__pyx_v_newxs = NULL;
  PyObject *__pyx_v_newys = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("removepoint", 0);

  /* "bpf4/core.pyx":2326
 *         ```
 *         """
 *         cdef int index = _csearchsorted_left(self.xs_data, self.xs.size, x)             # <<<<<<<<<<<<<<
 *         if self.xs_data[index] != x:
 *             raise ValueError("%f is not in points" % x)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->xs), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_index = __pyx_f_4bpf4_4core__csearchsorted_left(__pyx_v_self->xs_data, __pyx_t_2, __pyx_v_x);

  /* "bpf4/core.pyx":2327
 *         """
 *         cdef int index = _csearchsorted_left(self.xs_data, self.xs.size, x)
 *         if self.xs_data[index] != x:             # <<<<<<<<<<<<<<
 *             raise ValueError("%f is not in points" % x)
 *         newxs = numpy.delete(self.xs, index)
 */
  __pyx_t_3 = (((__pyx_v_self->xs_data[__pyx_v_index]) != __pyx_v_x) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "bpf4/core.pyx":2328
 *         cdef int index = _csearchsorted_left(self.xs_data, self.xs.size, x)
 *         if self.xs_data[index] != x:
 *             raise ValueError("%f is not in points" % x)             # <<<<<<<<<<<<<<
 *         newxs = numpy.delete(self.xs, index)
 *         newys = numpy.delete(self.ys, index)
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_f_is_not_in_points, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2328, __pyx_L1_error)

    /* "bpf4/core.pyx":2327
 *         """
 *         cdef int index = _csearchsorted_left(self.xs_data, self.xs.size, x)
 *         if self.xs_data[index] != x:             # <<<<<<<<<<<<<<
 *             raise ValueError("%f is not in points" % x)
 *         newxs = numpy.delete(self.xs, index)
 */
  }

  /* "bpf4/core.pyx":2329
 *         if self.xs_data[index] != x:
 *             raise ValueError("%f is not in points" % x)
 *         newxs = numpy.delete(self.xs, index)             # <<<<<<<<<<<<<<
 *         newys = numpy.delete(self.ys, index)
 *         return self.clone_with_new_data(newxs, newys)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_delete); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  __pyx_t_2 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_2 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self->xs), __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2329, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self->xs), __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2329, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self->xs));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->xs));
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_2, ((PyObject *)__pyx_v_self->xs));
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_2, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_newxs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2330
 *             raise ValueError("%f is not in points" % x)
 *         newxs = numpy.delete(self.xs, index)
 *         newys = numpy.delete(self.ys, index)             # <<<<<<<<<<<<<<
 *         return self.clone_with_new_data(newxs, newys)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_delete); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  __pyx_t_2 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_2 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self->ys), __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2330, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self->ys), __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2330, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self->ys));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->ys));
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, ((PyObject *)__pyx_v_self->ys));
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_newys = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2331
 *         newxs = numpy.delete(self.xs, index)
 *         newys = numpy.delete(self.ys, index)
 *         return self.clone_with_new_data(newxs, newys)             # <<<<<<<<<<<<<<
 * 
 *     def segments(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clone_with_new_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = NULL;
  __pyx_t_2 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_2 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_newxs, __pyx_v_newys};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2331, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_newxs, __pyx_v_newys};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2331, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_newxs);
    __Pyx_GIVEREF(__pyx_v_newxs);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_2, __pyx_v_newxs);
    __Pyx_INCREF(__pyx_v_newys);
    __Pyx_GIVEREF(__pyx_v_newys);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_2, __pyx_v_newys);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2303
 *         return self.clone_with_new_data(new_xs, new_ys)
 * 
 *     def removepoint(self, double x):             # <<<<<<<<<<<<<<
 *         """
 *         Return a copy of this bpf with point at x removed
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bpf4.core.BpfBase.removepoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_newxs);
  __Pyx_XDECREF(__pyx_v_newys);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4bpf4_4core_7BpfBase_32generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "bpf4/core.pyx":2333
 *         return self.clone_with_new_data(newxs, newys)
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return an iterator over the segments of this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_31segments(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7BpfBase_30segments[] = "BpfBase.segments(self)\n\n        Return an iterator over the segments of this bpf\n\n        Returns:\n            (Iterable[tuple[float, float, str, float]]) An iterator of segments, \n            where each segment has the form `(x, y, interpoltype:str, exponent)`\n\n        Each segment is a tuple `(x: float, y: float, interpoltype: str, exponent: float)`\n\n        Exponent is only of value if the interpolation type makes use of it.\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7BpfBase_31segments = {"segments", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_31segments, METH_NOARGS, __pyx_doc_4bpf4_4core_7BpfBase_30segments};
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_31segments(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segments (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_30segments(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_30segments(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self) {
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segments", 0);
  __pyx_cur_scope = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments *)__pyx_tp_new_4bpf4_4core___pyx_scope_struct__segments(__pyx_ptype_4bpf4_4core___pyx_scope_struct__segments, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2333, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4bpf4_4core_7BpfBase_32generator, __pyx_codeobj__26, (PyObject *) __pyx_cur_scope, __pyx_n_s_segments, __pyx_n_s_BpfBase_segments, __pyx_n_s_bpf4_core); if (unlikely(!gen)) __PYX_ERR(0, 2333, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core.BpfBase.segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4bpf4_4core_7BpfBase_32generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments *__pyx_cur_scope = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  size_t __pyx_t_6;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segments", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    case 2: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2333, __pyx_L1_error)

  /* "bpf4/core.pyx":2347
 *         cdef size_t i
 *         cdef size_t num_segments
 *         num_segments = len(self.xs) - 1             # <<<<<<<<<<<<<<
 *         interpoltype = self.__class__.__name__.lower()
 *         for i in range(num_segments):
 */
  __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_v_self->xs);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_cur_scope->__pyx_v_num_segments = (__pyx_t_2 - 1);

  /* "bpf4/core.pyx":2348
 *         cdef size_t num_segments
 *         num_segments = len(self.xs) - 1
 *         interpoltype = self.__class__.__name__.lower()             # <<<<<<<<<<<<<<
 *         for i in range(num_segments):
 *             yield (float(self.xs[i]), float(self.ys[i]), interpoltype, self.interpol_func.exp)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_interpoltype = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2349
 *         num_segments = len(self.xs) - 1
 *         interpoltype = self.__class__.__name__.lower()
 *         for i in range(num_segments):             # <<<<<<<<<<<<<<
 *             yield (float(self.xs[i]), float(self.ys[i]), interpoltype, self.interpol_func.exp)
 *         yield (float(self.xs[num_segments]), float(self.ys[num_segments]), '', 0)
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_num_segments;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_7;

    /* "bpf4/core.pyx":2350
 *         interpoltype = self.__class__.__name__.lower()
 *         for i in range(num_segments):
 *             yield (float(self.xs[i]), float(self.ys[i]), interpoltype, self.interpol_func.exp)             # <<<<<<<<<<<<<<
 *         yield (float(self.xs[num_segments]), float(self.ys[num_segments]), '', 0)
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->xs), __pyx_cur_scope->__pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->ys), __pyx_cur_scope->__pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->interpol_func->exp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_interpoltype);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_interpoltype);
    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_cur_scope->__pyx_v_interpoltype);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_5;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_6;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_6 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_7 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2350, __pyx_L1_error)
  }

  /* "bpf4/core.pyx":2351
 *         for i in range(num_segments):
 *             yield (float(self.xs[i]), float(self.ys[i]), interpoltype, self.interpol_func.exp)
 *         yield (float(self.xs[num_segments]), float(self.ys[num_segments]), '', 0)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_8 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->xs), __pyx_cur_scope->__pyx_v_num_segments, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyNumber_Float(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->ys), __pyx_cur_scope->__pyx_v_num_segments, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyNumber_Float(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4);
  __Pyx_INCREF(__pyx_kp_u__6);
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_u__6);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_int_0);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 2;
  return __pyx_r;
  __pyx_L7_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2351, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "bpf4/core.pyx":2333
 *         return self.clone_with_new_data(newxs, newys)
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return an iterator over the segments of this bpf
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2354
 * 
 *     @property
 *     def exp(self) -> float:             # <<<<<<<<<<<<<<
 *         """
 *         The exponential of the interpolation function of this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_3exp_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_7BpfBase_3exp_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7BpfBase_3exp___get__(((struct __pyx_obj_4bpf4_4core_BpfBase *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7BpfBase_3exp___get__(struct __pyx_obj_4bpf4_4core_BpfBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bpf4/core.pyx":2358
 *         The exponential of the interpolation function of this bpf
 *         """
 *         return self.interpol_func.exp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->interpol_func->exp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2354
 * 
 *     @property
 *     def exp(self) -> float:             # <<<<<<<<<<<<<<
 *         """
 *         The exponential of the interpolation function of this bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.BpfBase.exp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2373
 * 
 *     """
 *     def __init__(self, xs, ys):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_6Linear_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_6Linear___init__[] = "\n        Args:\n            xs (ndarray): the x-coord data\n            ys (ndarray): the y-coord data\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_6Linear___init__;
#endif
static int __pyx_pw_4bpf4_4core_6Linear_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2373, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2373, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2373, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Linear.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_6Linear___init__(((struct __pyx_obj_4bpf4_4core_Linear *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_6Linear___init__(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":2379
 *             ys (ndarray): the y-coord data
 *         """
 *         self.interpol_func = InterpolFunc_linear             # <<<<<<<<<<<<<<
 *         BpfBase.__init__(self, xs, ys)
 * 
 */
  __pyx_v_self->__pyx_base.interpol_func = __pyx_v_4bpf4_4core_InterpolFunc_linear;

  /* "bpf4/core.pyx":2380
 *         """
 *         self.interpol_func = InterpolFunc_linear
 *         BpfBase.__init__(self, xs, ys)             # <<<<<<<<<<<<<<
 * 
 *     def _get_points_for_rendering(self, int n= -1):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2380, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2380, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_xs);
    __Pyx_GIVEREF(__pyx_v_xs);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_xs);
    __Pyx_INCREF(__pyx_v_ys);
    __Pyx_GIVEREF(__pyx_v_ys);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ys);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2373
 * 
 *     """
 *     def __init__(self, xs, ys):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.Linear.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2382
 *         BpfBase.__init__(self, xs, ys)
 * 
 *     def _get_points_for_rendering(self, int n= -1):             # <<<<<<<<<<<<<<
 *         return self.xs, self.ys
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_6Linear_3_get_points_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_6Linear_2_get_points_for_rendering[] = "Linear._get_points_for_rendering(self, int n=-1)";
static PyMethodDef __pyx_mdef_4bpf4_4core_6Linear_3_get_points_for_rendering = {"_get_points_for_rendering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_6Linear_3_get_points_for_rendering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_6Linear_2_get_points_for_rendering};
static PyObject *__pyx_pw_4bpf4_4core_6Linear_3_get_points_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED int __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_points_for_rendering (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_points_for_rendering") < 0)) __PYX_ERR(0, 2382, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2382, __pyx_L3_error)
    } else {
      __pyx_v_n = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_points_for_rendering", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2382, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Linear._get_points_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_6Linear_2_get_points_for_rendering(((struct __pyx_obj_4bpf4_4core_Linear *)__pyx_v_self), __pyx_v_n);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_6Linear_2_get_points_for_rendering(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self, CYTHON_UNUSED int __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_points_for_rendering", 0);

  /* "bpf4/core.pyx":2383
 * 
 *     def _get_points_for_rendering(self, int n= -1):
 *         return self.xs, self.ys             # <<<<<<<<<<<<<<
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->__pyx_base.xs));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->__pyx_base.ys));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2382
 *         BpfBase.__init__(self, xs, ys)
 * 
 *     def _get_points_for_rendering(self, int n= -1):             # <<<<<<<<<<<<<<
 *         return self.xs, self.ys
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Linear._get_points_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2385
 *         return self.xs, self.ys
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between the given x coords
 */

static PyObject *__pyx_pw_4bpf4_4core_6Linear_5integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_4bpf4_4core_6Linear_integrate_between(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_6Linear_integrate_between *__pyx_optional_args) {
  size_t __pyx_v_N = ((size_t)0);
  double __pyx_v_pre;
  double __pyx_v_mid;
  double __pyx_v_post;
  size_t __pyx_v_index0;
  size_t __pyx_v_index1;
  size_t __pyx_v_i;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_t_11;
  size_t __pyx_t_12;
  size_t __pyx_t_13;
  size_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2385, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_6Linear_5integrate_between)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2385, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2385, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2385, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2385, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2385, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2385, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":2400
 *         cdef double pre, mid, post
 *         cdef size_t index0, index1
 *         if x0 <= self._x0:             # <<<<<<<<<<<<<<
 *             pre = self.__ccall__(x0) * (self._x0 - x0)
 *             index0 = 0
 */
  __pyx_t_11 = ((__pyx_v_x0 <= __pyx_v_self->__pyx_base.__pyx_base._x0) != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":2401
 *         cdef size_t index0, index1
 *         if x0 <= self._x0:
 *             pre = self.__ccall__(x0) * (self._x0 - x0)             # <<<<<<<<<<<<<<
 *             index0 = 0
 *         else:
 */
    __pyx_v_pre = (((struct __pyx_vtabstruct_4bpf4_4core_Linear *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx___ccall__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0) * (__pyx_v_self->__pyx_base.__pyx_base._x0 - __pyx_v_x0));

    /* "bpf4/core.pyx":2402
 *         if x0 <= self._x0:
 *             pre = self.__ccall__(x0) * (self._x0 - x0)
 *             index0 = 0             # <<<<<<<<<<<<<<
 *         else:
 *             index0 = _csearchsorted(self.xs_data, self.xs_size, x0)
 */
    __pyx_v_index0 = 0;

    /* "bpf4/core.pyx":2400
 *         cdef double pre, mid, post
 *         cdef size_t index0, index1
 *         if x0 <= self._x0:             # <<<<<<<<<<<<<<
 *             pre = self.__ccall__(x0) * (self._x0 - x0)
 *             index0 = 0
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2404
 *             index0 = 0
 *         else:
 *             index0 = _csearchsorted(self.xs_data, self.xs_size, x0)             # <<<<<<<<<<<<<<
 *             # trapezium = (a+b)/2 * h (where h is the distance between a and b)
 *             pre = (self.ys_data[index0] + self.__ccall__(x0)) * 0.5 * (self.xs_data[index0] - x0)
 */
  /*else*/ {
    __pyx_v_index0 = __pyx_f_4bpf4_4core__csearchsorted(__pyx_v_self->__pyx_base.xs_data, __pyx_v_self->__pyx_base.xs_size, __pyx_v_x0);

    /* "bpf4/core.pyx":2406
 *             index0 = _csearchsorted(self.xs_data, self.xs_size, x0)
 *             # trapezium = (a+b)/2 * h (where h is the distance between a and b)
 *             pre = (self.ys_data[index0] + self.__ccall__(x0)) * 0.5 * (self.xs_data[index0] - x0)             # <<<<<<<<<<<<<<
 *         if x1 >= self._x1:
 *             post = self.__ccall__(x1) * (x1 - self._x1)
 */
    __pyx_v_pre = ((((__pyx_v_self->__pyx_base.ys_data[__pyx_v_index0]) + ((struct __pyx_vtabstruct_4bpf4_4core_Linear *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx___ccall__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0)) * 0.5) * ((__pyx_v_self->__pyx_base.xs_data[__pyx_v_index0]) - __pyx_v_x0));
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":2407
 *             # trapezium = (a+b)/2 * h (where h is the distance between a and b)
 *             pre = (self.ys_data[index0] + self.__ccall__(x0)) * 0.5 * (self.xs_data[index0] - x0)
 *         if x1 >= self._x1:             # <<<<<<<<<<<<<<
 *             post = self.__ccall__(x1) * (x1 - self._x1)
 *             index1 = self.xs_size - 1
 */
  __pyx_t_11 = ((__pyx_v_x1 >= __pyx_v_self->__pyx_base.__pyx_base._x1) != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":2408
 *             pre = (self.ys_data[index0] + self.__ccall__(x0)) * 0.5 * (self.xs_data[index0] - x0)
 *         if x1 >= self._x1:
 *             post = self.__ccall__(x1) * (x1 - self._x1)             # <<<<<<<<<<<<<<
 *             index1 = self.xs_size - 1
 *         else:
 */
    __pyx_v_post = (((struct __pyx_vtabstruct_4bpf4_4core_Linear *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx___ccall__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x1) * (__pyx_v_x1 - __pyx_v_self->__pyx_base.__pyx_base._x1));

    /* "bpf4/core.pyx":2409
 *         if x1 >= self._x1:
 *             post = self.__ccall__(x1) * (x1 - self._x1)
 *             index1 = self.xs_size - 1             # <<<<<<<<<<<<<<
 *         else:
 *             index1 = _csearchsorted_left(self.xs_data, self.xs_size, x1) - 1
 */
    __pyx_v_index1 = (__pyx_v_self->__pyx_base.xs_size - 1);

    /* "bpf4/core.pyx":2407
 *             # trapezium = (a+b)/2 * h (where h is the distance between a and b)
 *             pre = (self.ys_data[index0] + self.__ccall__(x0)) * 0.5 * (self.xs_data[index0] - x0)
 *         if x1 >= self._x1:             # <<<<<<<<<<<<<<
 *             post = self.__ccall__(x1) * (x1 - self._x1)
 *             index1 = self.xs_size - 1
 */
    goto __pyx_L4;
  }

  /* "bpf4/core.pyx":2411
 *             index1 = self.xs_size - 1
 *         else:
 *             index1 = _csearchsorted_left(self.xs_data, self.xs_size, x1) - 1             # <<<<<<<<<<<<<<
 *             post = (self.ys_data[index1] + self.__ccall__(x1)) * 0.5 * (x1-self.xs_data[index1])
 *         mid = 0
 */
  /*else*/ {
    __pyx_v_index1 = (__pyx_f_4bpf4_4core__csearchsorted_left(__pyx_v_self->__pyx_base.xs_data, __pyx_v_self->__pyx_base.xs_size, __pyx_v_x1) - 1);

    /* "bpf4/core.pyx":2412
 *         else:
 *             index1 = _csearchsorted_left(self.xs_data, self.xs_size, x1) - 1
 *             post = (self.ys_data[index1] + self.__ccall__(x1)) * 0.5 * (x1-self.xs_data[index1])             # <<<<<<<<<<<<<<
 *         mid = 0
 *         for i in range(index0, index1):
 */
    __pyx_v_post = ((((__pyx_v_self->__pyx_base.ys_data[__pyx_v_index1]) + ((struct __pyx_vtabstruct_4bpf4_4core_Linear *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx___ccall__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x1)) * 0.5) * (__pyx_v_x1 - (__pyx_v_self->__pyx_base.xs_data[__pyx_v_index1])));
  }
  __pyx_L4:;

  /* "bpf4/core.pyx":2413
 *             index1 = _csearchsorted_left(self.xs_data, self.xs_size, x1) - 1
 *             post = (self.ys_data[index1] + self.__ccall__(x1)) * 0.5 * (x1-self.xs_data[index1])
 *         mid = 0             # <<<<<<<<<<<<<<
 *         for i in range(index0, index1):
 *             mid += (self.ys_data[i] + self.ys_data[i+1]) * 0.5 * (self.xs_data[i+1] - self.xs_data[i])
 */
  __pyx_v_mid = 0.0;

  /* "bpf4/core.pyx":2414
 *             post = (self.ys_data[index1] + self.__ccall__(x1)) * 0.5 * (x1-self.xs_data[index1])
 *         mid = 0
 *         for i in range(index0, index1):             # <<<<<<<<<<<<<<
 *             mid += (self.ys_data[i] + self.ys_data[i+1]) * 0.5 * (self.xs_data[i+1] - self.xs_data[i])
 *         return pre + mid + post
 */
  __pyx_t_12 = __pyx_v_index1;
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_14 = __pyx_v_index0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
    __pyx_v_i = __pyx_t_14;

    /* "bpf4/core.pyx":2415
 *         mid = 0
 *         for i in range(index0, index1):
 *             mid += (self.ys_data[i] + self.ys_data[i+1]) * 0.5 * (self.xs_data[i+1] - self.xs_data[i])             # <<<<<<<<<<<<<<
 *         return pre + mid + post
 * 
 */
    __pyx_v_mid = (__pyx_v_mid + ((((__pyx_v_self->__pyx_base.ys_data[__pyx_v_i]) + (__pyx_v_self->__pyx_base.ys_data[(__pyx_v_i + 1)])) * 0.5) * ((__pyx_v_self->__pyx_base.xs_data[(__pyx_v_i + 1)]) - (__pyx_v_self->__pyx_base.xs_data[__pyx_v_i]))));
  }

  /* "bpf4/core.pyx":2416
 *         for i in range(index0, index1):
 *             mid += (self.ys_data[i] + self.ys_data[i+1]) * 0.5 * (self.xs_data[i+1] - self.xs_data[i])
 *         return pre + mid + post             # <<<<<<<<<<<<<<
 * 
 *     cpdef Linear sliced(self, double x0, double x1):
 */
  __pyx_r = ((__pyx_v_pre + __pyx_v_mid) + __pyx_v_post);
  goto __pyx_L0;

  /* "bpf4/core.pyx":2385
 *         return self.xs, self.ys
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between the given x coords
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("bpf4.core.Linear.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_6Linear_5integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_6Linear_4integrate_between[] = "Linear.integrate_between(self, double x0, double x1, size_t N=0) -> double\n\n        Integrate this bpf between the given x coords\n\n        Args:\n            x0 (float): start of integration\n            x1 (float): end of integration\n            N (int): number of integration steps\n\n        Returns:\n            (float) The result representing the area beneath the curve\n            between *x0* and *x1*\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_6Linear_5integrate_between = {"integrate_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_6Linear_5integrate_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_6Linear_4integrate_between};
static PyObject *__pyx_pw_4bpf4_4core_6Linear_5integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  size_t __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, 1); __PYX_ERR(0, 2385, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_between") < 0)) __PYX_ERR(0, 2385, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2385, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2385, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_N == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2385, __pyx_L3_error)
    } else {
      __pyx_v_N = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2385, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Linear.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_6Linear_4integrate_between(((struct __pyx_obj_4bpf4_4core_Linear *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_6Linear_4integrate_between(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core_Linear->__pyx_base.__pyx_base.integrate_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2); 
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.Linear.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2418
 *         return pre + mid + post
 * 
 *     cpdef Linear sliced(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         """
 *         Cut this bpf at the given points
 */

static PyObject *__pyx_pw_4bpf4_4core_6Linear_7sliced(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_4bpf4_4core_Linear *__pyx_f_4bpf4_4core_6Linear_sliced(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_X = NULL;
  PyObject *__pyx_v_Y = NULL;
  struct __pyx_obj_4bpf4_4core_Linear *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sliced", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sliced); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_6Linear_7sliced)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2418, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2418, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2418, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2418, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2418, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2418, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_Linear))))) __PYX_ERR(0, 2418, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_Linear *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":2435
 *         bpf. In this case a real `Linear` bpf is returned.
 *         """
 *         X, Y = arraytools.arrayslice(x0, x1, self.xs, self.ys)             # <<<<<<<<<<<<<<
 *         return Linear(X, Y)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_arraytools); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_arrayslice); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_v_self->__pyx_base.xs), ((PyObject *)__pyx_v_self->__pyx_base.ys)};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_v_self->__pyx_base.xs), ((PyObject *)__pyx_v_self->__pyx_base.ys)};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_t_8);
    __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_7, ((PyObject *)__pyx_v_self->__pyx_base.xs));
    __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
    PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_7, ((PyObject *)__pyx_v_self->__pyx_base.ys));
    __pyx_t_2 = 0;
    __pyx_t_8 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2435, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2435, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_X = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_Y = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bpf4/core.pyx":2436
 *         """
 *         X, Y = arraytools.arrayslice(x0, x1, self.xs, self.ys)
 *         return Linear(X, Y)             # <<<<<<<<<<<<<<
 * 
 *     def inverted(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_X);
  __Pyx_GIVEREF(__pyx_v_X);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_X);
  __Pyx_INCREF(__pyx_v_Y);
  __Pyx_GIVEREF(__pyx_v_Y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_Y);
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Linear), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_Linear *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2418
 *         return pre + mid + post
 * 
 *     cpdef Linear sliced(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         """
 *         Cut this bpf at the given points
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bpf4.core.Linear.sliced", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_X);
  __Pyx_XDECREF(__pyx_v_Y);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_6Linear_7sliced(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_6Linear_6sliced[] = "Linear.sliced(self, double x0, double x1) -> Linear\n\n        Cut this bpf at the given points\n\n        Args:\n            x0 (float): start x to cut\n            x1 (float): end x to cut\n\n        Returns:\n            (Linear) Copy of this bpf cut at the given x-coords\n\n        If needed it inserts points at the given coordinates to limit this bpf to \n        the range `x0:x1`.\n\n        **NB**: this is different from crop, which is just a \"view\" into the underlying\n        bpf. In this case a real `Linear` bpf is returned. \n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_6Linear_7sliced = {"sliced", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_6Linear_7sliced, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_6Linear_6sliced};
static PyObject *__pyx_pw_4bpf4_4core_6Linear_7sliced(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sliced (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sliced", 1, 2, 2, 1); __PYX_ERR(0, 2418, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sliced") < 0)) __PYX_ERR(0, 2418, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2418, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2418, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sliced", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2418, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Linear.sliced", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_6Linear_6sliced(((struct __pyx_obj_4bpf4_4core_Linear *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_6Linear_6sliced(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sliced", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_6Linear_sliced(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Linear.sliced", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2438
 *         return Linear(X, Y)
 * 
 *     def inverted(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a new Linear bpf where x and y coordinates are inverted.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_6Linear_9inverted(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_6Linear_8inverted[] = "Linear.inverted(self)\n\n        Return a new Linear bpf where x and y coordinates are inverted. \n\n        This is only possible if y never decreases in value. Otherwise\n        a `ValueError` is thrown\n        \n        Returns:\n            (Linear) The inverted bpf\n\n        ![](assets/inverted.png)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_6Linear_9inverted = {"inverted", (PyCFunction)__pyx_pw_4bpf4_4core_6Linear_9inverted, METH_NOARGS, __pyx_doc_4bpf4_4core_6Linear_8inverted};
static PyObject *__pyx_pw_4bpf4_4core_6Linear_9inverted(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inverted (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_6Linear_8inverted(((struct __pyx_obj_4bpf4_4core_Linear *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_6Linear_8inverted(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self) {
  int __pyx_v_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("inverted", 0);

  /* "bpf4/core.pyx":2450
 *         ![](assets/inverted.png)
 *         """
 *         res = _array_issorted(self.ys)             # <<<<<<<<<<<<<<
 *         if res == -1 or res == 0:  # not sorted or has dups
 *             raise ValueError(f"bpf can't be inverted, ys must always increase.\nys={self.ys}")
 */
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(((PyObject *)__pyx_v_self->__pyx_base.ys), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 2450, __pyx_L1_error)
  __pyx_v_res = __pyx_f_4bpf4_4core__array_issorted(__pyx_t_1, 0);
  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
  __pyx_t_1.memview = NULL;
  __pyx_t_1.data = NULL;

  /* "bpf4/core.pyx":2451
 *         """
 *         res = _array_issorted(self.ys)
 *         if res == -1 or res == 0:  # not sorted or has dups             # <<<<<<<<<<<<<<
 *             raise ValueError(f"bpf can't be inverted, ys must always increase.\nys={self.ys}")
 *         return Linear(self.ys, self.xs)
 */
  switch (__pyx_v_res) {
    case -1L:
    case 0:

    /* "bpf4/core.pyx":2452
 *         res = _array_issorted(self.ys)
 *         if res == -1 or res == 0:  # not sorted or has dups
 *             raise ValueError(f"bpf can't be inverted, ys must always increase.\nys={self.ys}")             # <<<<<<<<<<<<<<
 *         return Linear(self.ys, self.xs)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(((PyObject *)__pyx_v_self->__pyx_base.ys), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_bpf_can_t_be_inverted_ys_must_al, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2452, __pyx_L1_error)

    /* "bpf4/core.pyx":2451
 *         """
 *         res = _array_issorted(self.ys)
 *         if res == -1 or res == 0:  # not sorted or has dups             # <<<<<<<<<<<<<<
 *             raise ValueError(f"bpf can't be inverted, ys must always increase.\nys={self.ys}")
 *         return Linear(self.ys, self.xs)
 */
    break;
    default: break;
  }

  /* "bpf4/core.pyx":2453
 *         if res == -1 or res == 0:  # not sorted or has dups
 *             raise ValueError(f"bpf can't be inverted, ys must always increase.\nys={self.ys}")
 *         return Linear(self.ys, self.xs)             # <<<<<<<<<<<<<<
 * 
 *     def flatpairs(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->__pyx_base.ys));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->__pyx_base.xs));
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Linear), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2438
 *         return Linear(X, Y)
 * 
 *     def inverted(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a new Linear bpf where x and y coordinates are inverted.
 */

  /* function exit code */
  __pyx_L1_error:;
  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.Linear.inverted", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2455
 *         return Linear(self.ys, self.xs)
 * 
 *     def flatpairs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a flat 1D array with x and y values interlaced
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_6Linear_11flatpairs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_6Linear_10flatpairs[] = "Linear.flatpairs(self)\n\n        Returns a flat 1D array with x and y values interlaced\n\n        Returns:\n            (ndarray) A 1D array representing the points of this bpf with *xs* and\n            *ys* interleaved\n\n        ```python\n\n        >>> a = linear(0, 0, 1, 10, 2, 20)\n        >>> a.flatpairs()\n        array([0, 0, 1, 10, 2, 20])\n\n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_6Linear_11flatpairs = {"flatpairs", (PyCFunction)__pyx_pw_4bpf4_4core_6Linear_11flatpairs, METH_NOARGS, __pyx_doc_4bpf4_4core_6Linear_10flatpairs};
static PyObject *__pyx_pw_4bpf4_4core_6Linear_11flatpairs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatpairs (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_6Linear_10flatpairs(((struct __pyx_obj_4bpf4_4core_Linear *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_6Linear_10flatpairs(struct __pyx_obj_4bpf4_4core_Linear *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flatpairs", 0);

  /* "bpf4/core.pyx":2471
 *         ```
 *         """
 *         return arraytools.interlace_arrays(self.xs, self.ys)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_arraytools); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_interlace_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self->__pyx_base.xs), ((PyObject *)__pyx_v_self->__pyx_base.ys)};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2471, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self->__pyx_base.xs), ((PyObject *)__pyx_v_self->__pyx_base.ys)};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2471, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self->__pyx_base.xs));
    __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_self->__pyx_base.ys));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2455
 *         return Linear(self.ys, self.xs)
 * 
 *     def flatpairs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a flat 1D array with x and y values interlaced
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.Linear.flatpairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2493
 *     """
 * 
 *     def __init__(self, xs, ys, int numiter=1):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_6Smooth_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_6Smooth___init__[] = "\n        Args:\n            xs (ndarray): the x-coord data\n            ys (ndarray): the y-coord data\n            numiter (int): the number of smoothstep steps\n\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_6Smooth___init__;
#endif
static int __pyx_pw_4bpf4_4core_6Smooth_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  int __pyx_v_numiter;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,&__pyx_n_s_numiter,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 2493, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numiter);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2493, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
    if (values[2]) {
      __pyx_v_numiter = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_numiter == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2493, __pyx_L3_error)
    } else {
      __pyx_v_numiter = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2493, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Smooth.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_6Smooth___init__(((struct __pyx_obj_4bpf4_4core_Smooth *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys, __pyx_v_numiter);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_6Smooth___init__(struct __pyx_obj_4bpf4_4core_Smooth *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, int __pyx_v_numiter) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":2501
 * 
 *         """
 *         if numiter == 1:             # <<<<<<<<<<<<<<
 *             self.interpol_func = InterpolFunc_smooth
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_numiter == 1) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":2502
 *         """
 *         if numiter == 1:
 *             self.interpol_func = InterpolFunc_smooth             # <<<<<<<<<<<<<<
 *         else:
 *             self.interpol_func = InterpolFunc_new(intrp_smooth, 1, "smooth", 1)
 */
    __pyx_v_self->__pyx_base.interpol_func = __pyx_v_4bpf4_4core_InterpolFunc_smooth;

    /* "bpf4/core.pyx":2501
 * 
 *         """
 *         if numiter == 1:             # <<<<<<<<<<<<<<
 *             self.interpol_func = InterpolFunc_smooth
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2504
 *             self.interpol_func = InterpolFunc_smooth
 *         else:
 *             self.interpol_func = InterpolFunc_new(intrp_smooth, 1, "smooth", 1)             # <<<<<<<<<<<<<<
 *             self.interpol_func.numiter = numiter
 *         BpfBase.__init__(self, xs, ys)
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.interpol_func = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_smooth, 1.0, ((char *)"smooth"), 1);

    /* "bpf4/core.pyx":2505
 *         else:
 *             self.interpol_func = InterpolFunc_new(intrp_smooth, 1, "smooth", 1)
 *             self.interpol_func.numiter = numiter             # <<<<<<<<<<<<<<
 *         BpfBase.__init__(self, xs, ys)
 * 
 */
    __pyx_v_self->__pyx_base.interpol_func->numiter = __pyx_v_numiter;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":2506
 *             self.interpol_func = InterpolFunc_new(intrp_smooth, 1, "smooth", 1)
 *             self.interpol_func.numiter = numiter
 *         BpfBase.__init__(self, xs, ys)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase), __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2506, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2506, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_xs);
    __Pyx_GIVEREF(__pyx_v_xs);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_xs);
    __Pyx_INCREF(__pyx_v_ys);
    __Pyx_GIVEREF(__pyx_v_ys);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_ys);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bpf4/core.pyx":2493
 *     """
 * 
 *     def __init__(self, xs, ys, int numiter=1):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core.Smooth.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2524
 * 
 *     """
 *     def __init__(self, xs, ys):             # <<<<<<<<<<<<<<
 *         self.interpol_func = InterpolFunc_smoother
 *         BpfBase.__init__(self, xs, ys)
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_8Smoother_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_8Smoother_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2524, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2524, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2524, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Smoother.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_8Smoother___init__(((struct __pyx_obj_4bpf4_4core_Smoother *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_8Smoother___init__(struct __pyx_obj_4bpf4_4core_Smoother *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":2525
 *     """
 *     def __init__(self, xs, ys):
 *         self.interpol_func = InterpolFunc_smoother             # <<<<<<<<<<<<<<
 *         BpfBase.__init__(self, xs, ys)
 * 
 */
  __pyx_v_self->__pyx_base.interpol_func = __pyx_v_4bpf4_4core_InterpolFunc_smoother;

  /* "bpf4/core.pyx":2526
 *     def __init__(self, xs, ys):
 *         self.interpol_func = InterpolFunc_smoother
 *         BpfBase.__init__(self, xs, ys)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2526, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2526, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_xs);
    __Pyx_GIVEREF(__pyx_v_xs);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_xs);
    __Pyx_INCREF(__pyx_v_ys);
    __Pyx_GIVEREF(__pyx_v_ys);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ys);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2524
 * 
 *     """
 *     def __init__(self, xs, ys):             # <<<<<<<<<<<<<<
 *         self.interpol_func = InterpolFunc_smoother
 *         BpfBase.__init__(self, xs, ys)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.Smoother.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2547
 *     ![](assets/Halfcos.png)
 *     """
 *     def __init__(self, xs, ys, double exp=1.0, int numiter=1):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_7Halfcos_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7Halfcos___init__[] = "\n        Args:\n            xs (ndarray): the x-coord data\n            ys (ndarray): the y-coord data\n            exp (float): an exponent applied to the halfcosine interpolation\n            numiter (int): how many times to apply the interpolation\n\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_7Halfcos___init__;
#endif
static int __pyx_pw_4bpf4_4core_7Halfcos_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  double __pyx_v_exp;
  int __pyx_v_numiter;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,&__pyx_n_s_exp,&__pyx_n_s_numiter,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 2547, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exp);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numiter);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2547, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
    if (values[2]) {
      __pyx_v_exp = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_exp == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2547, __pyx_L3_error)
    } else {
      __pyx_v_exp = ((double)1.0);
    }
    if (values[3]) {
      __pyx_v_numiter = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_numiter == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2547, __pyx_L3_error)
    } else {
      __pyx_v_numiter = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2547, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Halfcos.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_7Halfcos___init__(((struct __pyx_obj_4bpf4_4core_Halfcos *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys, __pyx_v_exp, __pyx_v_numiter);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_7Halfcos___init__(struct __pyx_obj_4bpf4_4core_Halfcos *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, double __pyx_v_exp, int __pyx_v_numiter) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":2556
 * 
 *         """
 *         if exp == 1.0 and numiter == 1:             # <<<<<<<<<<<<<<
 *             self.interpol_func = InterpolFunc_halfcos
 *         elif exp == 1:
 */
  __pyx_t_2 = ((__pyx_v_exp == 1.0) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_numiter == 1) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":2557
 *         """
 *         if exp == 1.0 and numiter == 1:
 *             self.interpol_func = InterpolFunc_halfcos             # <<<<<<<<<<<<<<
 *         elif exp == 1:
 *             self.interpol_func = InterpolFunc_new(intrp_halfcos, 1, 'halfcos', 1)
 */
    __pyx_v_self->__pyx_base.interpol_func = __pyx_v_4bpf4_4core_InterpolFunc_halfcos;

    /* "bpf4/core.pyx":2556
 * 
 *         """
 *         if exp == 1.0 and numiter == 1:             # <<<<<<<<<<<<<<
 *             self.interpol_func = InterpolFunc_halfcos
 *         elif exp == 1:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2558
 *         if exp == 1.0 and numiter == 1:
 *             self.interpol_func = InterpolFunc_halfcos
 *         elif exp == 1:             # <<<<<<<<<<<<<<
 *             self.interpol_func = InterpolFunc_new(intrp_halfcos, 1, 'halfcos', 1)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_exp == 1.0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":2559
 *             self.interpol_func = InterpolFunc_halfcos
 *         elif exp == 1:
 *             self.interpol_func = InterpolFunc_new(intrp_halfcos, 1, 'halfcos', 1)             # <<<<<<<<<<<<<<
 *         else:
 *             self.interpol_func = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 */
    __pyx_v_self->__pyx_base.interpol_func = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_halfcos, 1.0, ((char *)"halfcos"), 1);

    /* "bpf4/core.pyx":2558
 *         if exp == 1.0 and numiter == 1:
 *             self.interpol_func = InterpolFunc_halfcos
 *         elif exp == 1:             # <<<<<<<<<<<<<<
 *             self.interpol_func = InterpolFunc_new(intrp_halfcos, 1, 'halfcos', 1)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2561
 *             self.interpol_func = InterpolFunc_new(intrp_halfcos, 1, 'halfcos', 1)
 *         else:
 *             self.interpol_func = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)             # <<<<<<<<<<<<<<
 *         self.interpol_func.numiter = numiter
 *         super().__init__(xs, ys)
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.interpol_func = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_halfcosexp, __pyx_v_exp, ((char *)"halfcosexp"), 1);
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":2562
 *         else:
 *             self.interpol_func = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 *         self.interpol_func.numiter = numiter             # <<<<<<<<<<<<<<
 *         super().__init__(xs, ys)
 * 
 */
  __pyx_v_self->__pyx_base.interpol_func->numiter = __pyx_v_numiter;

  /* "bpf4/core.pyx":2563
 *             self.interpol_func = InterpolFunc_new(intrp_halfcosexp, exp, 'halfcosexp', 1)
 *         self.interpol_func.numiter = numiter
 *         super().__init__(xs, ys)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_4bpf4_4core_Halfcos));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4bpf4_4core_Halfcos));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_4bpf4_4core_Halfcos));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_xs, __pyx_v_ys};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2563, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_xs, __pyx_v_ys};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2563, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_xs);
    __Pyx_GIVEREF(__pyx_v_xs);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_xs);
    __Pyx_INCREF(__pyx_v_ys);
    __Pyx_GIVEREF(__pyx_v_ys);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_ys);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "bpf4/core.pyx":2547
 *     ![](assets/Halfcos.png)
 *     """
 *     def __init__(self, xs, ys, double exp=1.0, int numiter=1):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bpf4.core.Halfcos.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2565
 *         super().__init__(xs, ys)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.xs, self.ys, self.interpol_func.exp, self.interpol_func.numiter
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Halfcos_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7Halfcos_2__getstate__[] = "Halfcos.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Halfcos_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_7Halfcos_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_7Halfcos_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_7Halfcos_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Halfcos_2__getstate__(((struct __pyx_obj_4bpf4_4core_Halfcos *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Halfcos_2__getstate__(struct __pyx_obj_4bpf4_4core_Halfcos *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":2566
 * 
 *     def __getstate__(self):
 *         return self.xs, self.ys, self.interpol_func.exp, self.interpol_func.numiter             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.interpol_func->exp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.interpol_func->numiter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->__pyx_base.xs));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self->__pyx_base.ys));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2565
 *         super().__init__(xs, ys)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.xs, self.ys, self.interpol_func.exp, self.interpol_func.numiter
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.Halfcos.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2568
 *         return self.xs, self.ys, self.interpol_func.exp, self.interpol_func.numiter
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         exp = self.interpol_func.exp
 *         return "%s[%s:%s] exp=%s" % (self.__class__.__name__, str(self._x0), str(self._x1), str(exp))
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Halfcos_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_7Halfcos_5__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Halfcos_4__repr__(((struct __pyx_obj_4bpf4_4core_Halfcos *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Halfcos_4__repr__(struct __pyx_obj_4bpf4_4core_Halfcos *__pyx_v_self) {
  double __pyx_v_exp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "bpf4/core.pyx":2569
 * 
 *     def __repr__(self):
 *         exp = self.interpol_func.exp             # <<<<<<<<<<<<<<
 *         return "%s[%s:%s] exp=%s" % (self.__class__.__name__, str(self._x0), str(self._x1), str(exp))
 * 
 */
  __pyx_t_1 = __pyx_v_self->__pyx_base.interpol_func->exp;
  __pyx_v_exp = __pyx_t_1;

  /* "bpf4/core.pyx":2570
 *     def __repr__(self):
 *         exp = self.interpol_func.exp
 *         return "%s[%s:%s] exp=%s" % (self.__class__.__name__, str(self._x0), str(self._x1), str(exp))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_4 = 127;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__21);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__21);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__21);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base._x0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u__22);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__22);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u__22);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base._x1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u_exp_2);
  __pyx_t_3 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_exp_2);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_kp_u_exp_2);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_exp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 7, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2568
 *         return self.xs, self.ys, self.interpol_func.exp, self.interpol_func.numiter
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         exp = self.interpol_func.exp
 *         return "%s[%s:%s] exp=%s" % (self.__class__.__name__, str(self._x0), str(self._x1), str(exp))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core.Halfcos.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2593
 * 
 *     """
 *     def __init__(self, xs, ys, double exp=1.0, int numiter=1):             # <<<<<<<<<<<<<<
 *         self.interpol_func = InterpolFunc_new(intrp_halfcosexpm, exp, 'halfcosexpm', 1)
 *         self.interpol_func.numiter = numiter
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_8Halfcosm_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_8Halfcosm_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  double __pyx_v_exp;
  int __pyx_v_numiter;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,&__pyx_n_s_exp,&__pyx_n_s_numiter,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 2593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exp);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numiter);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2593, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
    if (values[2]) {
      __pyx_v_exp = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_exp == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2593, __pyx_L3_error)
    } else {
      __pyx_v_exp = ((double)1.0);
    }
    if (values[3]) {
      __pyx_v_numiter = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_numiter == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2593, __pyx_L3_error)
    } else {
      __pyx_v_numiter = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2593, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Halfcosm.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_8Halfcosm___init__(((struct __pyx_obj_4bpf4_4core_Halfcosm *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys, __pyx_v_exp, __pyx_v_numiter);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_8Halfcosm___init__(struct __pyx_obj_4bpf4_4core_Halfcosm *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, double __pyx_v_exp, int __pyx_v_numiter) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":2594
 *     """
 *     def __init__(self, xs, ys, double exp=1.0, int numiter=1):
 *         self.interpol_func = InterpolFunc_new(intrp_halfcosexpm, exp, 'halfcosexpm', 1)             # <<<<<<<<<<<<<<
 *         self.interpol_func.numiter = numiter
 *         BpfBase.__init__(self, xs, ys)
 */
  __pyx_v_self->__pyx_base.__pyx_base.interpol_func = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_halfcosexpm, __pyx_v_exp, ((char *)"halfcosexpm"), 1);

  /* "bpf4/core.pyx":2595
 *     def __init__(self, xs, ys, double exp=1.0, int numiter=1):
 *         self.interpol_func = InterpolFunc_new(intrp_halfcosexpm, exp, 'halfcosexpm', 1)
 *         self.interpol_func.numiter = numiter             # <<<<<<<<<<<<<<
 *         BpfBase.__init__(self, xs, ys)
 * 
 */
  __pyx_v_self->__pyx_base.__pyx_base.interpol_func->numiter = __pyx_v_numiter;

  /* "bpf4/core.pyx":2596
 *         self.interpol_func = InterpolFunc_new(intrp_halfcosexpm, exp, 'halfcosexpm', 1)
 *         self.interpol_func.numiter = numiter
 *         BpfBase.__init__(self, xs, ys)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2596, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2596, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_xs);
    __Pyx_GIVEREF(__pyx_v_xs);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_xs);
    __Pyx_INCREF(__pyx_v_ys);
    __Pyx_GIVEREF(__pyx_v_ys);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ys);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2593
 * 
 *     """
 *     def __init__(self, xs, ys, double exp=1.0, int numiter=1):             # <<<<<<<<<<<<<<
 *         self.interpol_func = InterpolFunc_new(intrp_halfcosexpm, exp, 'halfcosexpm', 1)
 *         self.interpol_func.numiter = numiter
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.Halfcosm.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2623
 *     ![](assets/expon-grid2.png)
 *     """
 *     def __init__(self, xs, ys, double exp, int numiter=1):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_5Expon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_5Expon___init__[] = "\n        Args:\n            xs (ndarray): the x-coord data\n            ys (ndarray): the y-coord data\n            exp (float): an exponent applied to the halfcosine interpolation\n            numiter (int): how many times to apply the interpolation\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_5Expon___init__;
#endif
static int __pyx_pw_4bpf4_4core_5Expon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  double __pyx_v_exp;
  int __pyx_v_numiter;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,&__pyx_n_s_exp,&__pyx_n_s_numiter,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 2623, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 2623, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numiter);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2623, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
    __pyx_v_exp = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_exp == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2623, __pyx_L3_error)
    if (values[3]) {
      __pyx_v_numiter = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_numiter == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2623, __pyx_L3_error)
    } else {
      __pyx_v_numiter = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2623, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Expon.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_5Expon___init__(((struct __pyx_obj_4bpf4_4core_Expon *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys, __pyx_v_exp, __pyx_v_numiter);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_5Expon___init__(struct __pyx_obj_4bpf4_4core_Expon *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, double __pyx_v_exp, int __pyx_v_numiter) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":2631
 *             numiter (int): how many times to apply the interpolation
 *         """
 *         BpfBase.__init__(self, xs, ys)             # <<<<<<<<<<<<<<
 *         self.interpol_func = InterpolFunc_new(intrp_expon, exp, 'expon', 1)  # must be freed
 *         self.interpol_func.numiter = numiter
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2631, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2631, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_xs);
    __Pyx_GIVEREF(__pyx_v_xs);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_xs);
    __Pyx_INCREF(__pyx_v_ys);
    __Pyx_GIVEREF(__pyx_v_ys);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ys);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2632
 *         """
 *         BpfBase.__init__(self, xs, ys)
 *         self.interpol_func = InterpolFunc_new(intrp_expon, exp, 'expon', 1)  # must be freed             # <<<<<<<<<<<<<<
 *         self.interpol_func.numiter = numiter
 * 
 */
  __pyx_v_self->__pyx_base.interpol_func = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_expon, __pyx_v_exp, ((char *)"expon"), 1);

  /* "bpf4/core.pyx":2633
 *         BpfBase.__init__(self, xs, ys)
 *         self.interpol_func = InterpolFunc_new(intrp_expon, exp, 'expon', 1)  # must be freed
 *         self.interpol_func.numiter = numiter             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self): return self.xs, self.ys, self.interpol_func.exp
 */
  __pyx_v_self->__pyx_base.interpol_func->numiter = __pyx_v_numiter;

  /* "bpf4/core.pyx":2623
 *     ![](assets/expon-grid2.png)
 *     """
 *     def __init__(self, xs, ys, double exp, int numiter=1):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.Expon.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2635
 *         self.interpol_func.numiter = numiter
 * 
 *     def __getstate__(self): return self.xs, self.ys, self.interpol_func.exp             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Expon_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_5Expon_2__getstate__[] = "Expon.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_5Expon_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_5Expon_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_5Expon_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_5Expon_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Expon_2__getstate__(((struct __pyx_obj_4bpf4_4core_Expon *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Expon_2__getstate__(struct __pyx_obj_4bpf4_4core_Expon *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.interpol_func->exp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->__pyx_base.xs));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->__pyx_base.ys));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core.Expon.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2637
 *     def __getstate__(self): return self.xs, self.ys, self.interpol_func.exp
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.xs, self.ys, exp = state
 *         self.interpol_func.exp = exp
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Expon_5__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_4bpf4_4core_5Expon_4__setstate__[] = "Expon.__setstate__(self, state)";
static PyMethodDef __pyx_mdef_4bpf4_4core_5Expon_5__setstate__ = {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_5Expon_5__setstate__, METH_O, __pyx_doc_4bpf4_4core_5Expon_4__setstate__};
static PyObject *__pyx_pw_4bpf4_4core_5Expon_5__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Expon_4__setstate__(((struct __pyx_obj_4bpf4_4core_Expon *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Expon_4__setstate__(struct __pyx_obj_4bpf4_4core_Expon *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_v_exp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  double __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "bpf4/core.pyx":2638
 * 
 *     def __setstate__(self, state):
 *         self.xs, self.ys, exp = state             # <<<<<<<<<<<<<<
 *         self.interpol_func.exp = exp
 * 
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_state))) || (PyList_CheckExact(__pyx_v_state))) {
    PyObject* sequence = __pyx_v_state;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2638, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_v_state); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) __PYX_ERR(0, 2638, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2638, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2638, __pyx_L1_error)
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2638, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.xs);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
  __pyx_v_self->__pyx_base.xs = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.ys);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
  __pyx_v_self->__pyx_base.ys = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_v_exp = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bpf4/core.pyx":2639
 *     def __setstate__(self, state):
 *         self.xs, self.ys, exp = state
 *         self.interpol_func.exp = exp             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_exp); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2639, __pyx_L1_error)
  __pyx_v_self->__pyx_base.interpol_func->exp = __pyx_t_6;

  /* "bpf4/core.pyx":2637
 *     def __getstate__(self): return self.xs, self.ys, self.interpol_func.exp
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.xs, self.ys, exp = state
 *         self.interpol_func.exp = exp
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.Expon.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2641
 *         self.interpol_func.exp = exp
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "%s[%s:%s] exp=%s" % (self.__class__.__name__, str(self._x0), str(self._x1), str(self.interpol_func.exp))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Expon_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_5Expon_7__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Expon_6__repr__(((struct __pyx_obj_4bpf4_4core_Expon *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Expon_6__repr__(struct __pyx_obj_4bpf4_4core_Expon *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "bpf4/core.pyx":2642
 * 
 *     def __repr__(self):
 *         return "%s[%s:%s] exp=%s" % (self.__class__.__name__, str(self._x0), str(self._x1), str(self.interpol_func.exp))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__21);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__21);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__21);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base._x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__22);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__22);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__22);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base._x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_exp_2);
  __pyx_t_2 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_exp_2);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_exp_2);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.interpol_func->exp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2641
 *         self.interpol_func.exp = exp
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "%s[%s:%s] exp=%s" % (self.__class__.__name__, str(self._x0), str(self._x1), str(self.interpol_func.exp))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.Expon.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2667
 * 
 *     """
 *     def __init__(self, xs, ys, double exp, int numiter=1):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_6Exponm_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_6Exponm___init__[] = "\n        Args:\n            xs (ndarray): the x-coord data\n            ys (ndarray): the y-coord data\n            exp (float): an exponent applied to the halfcosine interpolation\n            numiter (int): how many times to apply the interpolation\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_6Exponm___init__;
#endif
static int __pyx_pw_4bpf4_4core_6Exponm_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  double __pyx_v_exp;
  int __pyx_v_numiter;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,&__pyx_n_s_exp,&__pyx_n_s_numiter,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 2667, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 2667, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numiter);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2667, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
    __pyx_v_exp = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_exp == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2667, __pyx_L3_error)
    if (values[3]) {
      __pyx_v_numiter = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_numiter == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2667, __pyx_L3_error)
    } else {
      __pyx_v_numiter = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2667, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Exponm.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_6Exponm___init__(((struct __pyx_obj_4bpf4_4core_Exponm *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys, __pyx_v_exp, __pyx_v_numiter);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_6Exponm___init__(struct __pyx_obj_4bpf4_4core_Exponm *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, double __pyx_v_exp, int __pyx_v_numiter) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":2675
 *             numiter (int): how many times to apply the interpolation
 *         """
 *         BpfBase.__init__(self, xs, ys)             # <<<<<<<<<<<<<<
 *         self.interpol_func = InterpolFunc_new(intrp_exponm, exp, 'exponm', 1)  # must be freed
 *         self.interpol_func.numiter = numiter
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2675, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2675, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_xs);
    __Pyx_GIVEREF(__pyx_v_xs);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_xs);
    __Pyx_INCREF(__pyx_v_ys);
    __Pyx_GIVEREF(__pyx_v_ys);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ys);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2676
 *         """
 *         BpfBase.__init__(self, xs, ys)
 *         self.interpol_func = InterpolFunc_new(intrp_exponm, exp, 'exponm', 1)  # must be freed             # <<<<<<<<<<<<<<
 *         self.interpol_func.numiter = numiter
 * 
 */
  __pyx_v_self->__pyx_base.__pyx_base.interpol_func = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_exponm, __pyx_v_exp, ((char *)"exponm"), 1);

  /* "bpf4/core.pyx":2677
 *         BpfBase.__init__(self, xs, ys)
 *         self.interpol_func = InterpolFunc_new(intrp_exponm, exp, 'exponm', 1)  # must be freed
 *         self.interpol_func.numiter = numiter             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.__pyx_base.interpol_func->numiter = __pyx_v_numiter;

  /* "bpf4/core.pyx":2667
 * 
 *     """
 *     def __init__(self, xs, ys, double exp, int numiter=1):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.Exponm.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2695
 *     ![](assets/NoInterpol.png)
 *     """
 *     def __init__(self, xs, ys):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf without interpolation
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_10NoInterpol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_10NoInterpol___init__[] = "\n        A bpf without interpolation\n\n        Args:\n            xs (ndarray): the x coord data\n            ys (ndarray): the y coord data\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_10NoInterpol___init__;
#endif
static int __pyx_pw_4bpf4_4core_10NoInterpol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2695, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2695, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2695, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.NoInterpol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_10NoInterpol___init__(((struct __pyx_obj_4bpf4_4core_NoInterpol *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_10NoInterpol___init__(struct __pyx_obj_4bpf4_4core_NoInterpol *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":2703
 *             ys (ndarray): the y coord data
 *         """
 *         BpfBase.__init__(self, xs, ys)             # <<<<<<<<<<<<<<
 *         self.interpol_func = InterpolFunc_nointerpol
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2703, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2703, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_xs);
    __Pyx_GIVEREF(__pyx_v_xs);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_xs);
    __Pyx_INCREF(__pyx_v_ys);
    __Pyx_GIVEREF(__pyx_v_ys);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ys);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2704
 *         """
 *         BpfBase.__init__(self, xs, ys)
 *         self.interpol_func = InterpolFunc_nointerpol             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.interpol_func = __pyx_v_4bpf4_4core_InterpolFunc_nointerpol;

  /* "bpf4/core.pyx":2695
 *     ![](assets/NoInterpol.png)
 *     """
 *     def __init__(self, xs, ys):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf without interpolation
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.NoInterpol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2723
 * 
 *     """
 *     def __init__(self, xs, ys):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf with nearest interpolation
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_7Nearest_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7Nearest___init__[] = "\n        A bpf with nearest interpolation\n\n        Args:\n            xs (ndarray): the x coord data\n            ys (ndarray): the y coord data\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_7Nearest___init__;
#endif
static int __pyx_pw_4bpf4_4core_7Nearest_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2723, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2723, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2723, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Nearest.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_7Nearest___init__(((struct __pyx_obj_4bpf4_4core_Nearest *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_7Nearest___init__(struct __pyx_obj_4bpf4_4core_Nearest *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":2731
 *             ys (ndarray): the y coord data
 *         """
 *         super().__init__(xs, ys)             # <<<<<<<<<<<<<<
 *         self.interpol_func = InterpolFunc_nearest
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_4bpf4_4core_Nearest));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4bpf4_4core_Nearest));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_4bpf4_4core_Nearest));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2731, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_xs, __pyx_v_ys};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2731, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_xs);
    __Pyx_GIVEREF(__pyx_v_xs);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_xs);
    __Pyx_INCREF(__pyx_v_ys);
    __Pyx_GIVEREF(__pyx_v_ys);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_ys);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2732
 *         """
 *         super().__init__(xs, ys)
 *         self.interpol_func = InterpolFunc_nearest             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self): return self.xs, self.ys
 */
  __pyx_v_self->__pyx_base.interpol_func = __pyx_v_4bpf4_4core_InterpolFunc_nearest;

  /* "bpf4/core.pyx":2723
 * 
 *     """
 *     def __init__(self, xs, ys):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf with nearest interpolation
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.Nearest.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2734
 *         self.interpol_func = InterpolFunc_nearest
 * 
 *     def __getstate__(self): return self.xs, self.ys             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Nearest_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7Nearest_2__getstate__[] = "Nearest.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Nearest_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_7Nearest_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_7Nearest_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_7Nearest_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Nearest_2__getstate__(((struct __pyx_obj_4bpf4_4core_Nearest *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Nearest_2__getstate__(struct __pyx_obj_4bpf4_4core_Nearest *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.xs));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->__pyx_base.xs));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.ys));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->__pyx_base.ys));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Nearest.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2749
 * 
 * 
 * cdef SplineS* SplineS_new(xs, ys, Py_ssize_t xs_size, double low_slope=0, double high_slope=0, int use_low_slope=0, int use_high_slope=0):             # <<<<<<<<<<<<<<
 *     cdef SplineS *s = <SplineS *>malloc(sizeof(SplineS))
 *     cdef int length = xs_size
 */

static __pyx_t_4bpf4_4core_SplineS *__pyx_f_4bpf4_4core_SplineS_new(PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, Py_ssize_t __pyx_v_xs_size, struct __pyx_opt_args_4bpf4_4core_SplineS_new *__pyx_optional_args) {
  double __pyx_v_low_slope = ((double)0.0);
  double __pyx_v_high_slope = ((double)0.0);
  int __pyx_v_use_low_slope = ((int)0);
  int __pyx_v_use_high_slope = ((int)0);
  __pyx_t_4bpf4_4core_SplineS *__pyx_v_s;
  int __pyx_v_length;
  int __pyx_v_i;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v__xs;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v__ys;
  __pyx_t_4bpf4_4core_SplineS *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_4bpf4_4core_DTYPE_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SplineS_new", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_low_slope = __pyx_optional_args->low_slope;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_high_slope = __pyx_optional_args->high_slope;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_use_low_slope = __pyx_optional_args->use_low_slope;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_use_high_slope = __pyx_optional_args->use_high_slope;
          }
        }
      }
    }
  }

  /* "bpf4/core.pyx":2750
 * 
 * cdef SplineS* SplineS_new(xs, ys, Py_ssize_t xs_size, double low_slope=0, double high_slope=0, int use_low_slope=0, int use_high_slope=0):
 *     cdef SplineS *s = <SplineS *>malloc(sizeof(SplineS))             # <<<<<<<<<<<<<<
 *     cdef int length = xs_size
 *     cdef int i
 */
  __pyx_v_s = ((__pyx_t_4bpf4_4core_SplineS *)malloc((sizeof(__pyx_t_4bpf4_4core_SplineS))));

  /* "bpf4/core.pyx":2751
 * cdef SplineS* SplineS_new(xs, ys, Py_ssize_t xs_size, double low_slope=0, double high_slope=0, int use_low_slope=0, int use_high_slope=0):
 *     cdef SplineS *s = <SplineS *>malloc(sizeof(SplineS))
 *     cdef int length = xs_size             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef DTYPE_t * _xs = <DTYPE_t *>malloc(sizeof(DTYPE_t) * length)
 */
  __pyx_v_length = __pyx_v_xs_size;

  /* "bpf4/core.pyx":2753
 *     cdef int length = xs_size
 *     cdef int i
 *     cdef DTYPE_t * _xs = <DTYPE_t *>malloc(sizeof(DTYPE_t) * length)             # <<<<<<<<<<<<<<
 *     cdef DTYPE_t * _ys = <DTYPE_t *>malloc(sizeof(DTYPE_t) * length)
 *     for i in range(length):
 */
  __pyx_v__xs = ((__pyx_t_4bpf4_4core_DTYPE_t *)malloc(((sizeof(__pyx_t_4bpf4_4core_DTYPE_t)) * __pyx_v_length)));

  /* "bpf4/core.pyx":2754
 *     cdef int i
 *     cdef DTYPE_t * _xs = <DTYPE_t *>malloc(sizeof(DTYPE_t) * length)
 *     cdef DTYPE_t * _ys = <DTYPE_t *>malloc(sizeof(DTYPE_t) * length)             # <<<<<<<<<<<<<<
 *     for i in range(length):
 *         _xs[i] = xs[i]
 */
  __pyx_v__ys = ((__pyx_t_4bpf4_4core_DTYPE_t *)malloc(((sizeof(__pyx_t_4bpf4_4core_DTYPE_t)) * __pyx_v_length)));

  /* "bpf4/core.pyx":2755
 *     cdef DTYPE_t * _xs = <DTYPE_t *>malloc(sizeof(DTYPE_t) * length)
 *     cdef DTYPE_t * _ys = <DTYPE_t *>malloc(sizeof(DTYPE_t) * length)
 *     for i in range(length):             # <<<<<<<<<<<<<<
 *         _xs[i] = xs[i]
 *         _ys[i] = ys[i]
 */
  __pyx_t_1 = __pyx_v_length;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":2756
 *     cdef DTYPE_t * _ys = <DTYPE_t *>malloc(sizeof(DTYPE_t) * length)
 *     for i in range(length):
 *         _xs[i] = xs[i]             # <<<<<<<<<<<<<<
 *         _ys[i] = ys[i]
 *     s.xs = _xs
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_xs, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2756, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v__xs[__pyx_v_i]) = __pyx_t_5;

    /* "bpf4/core.pyx":2757
 *     for i in range(length):
 *         _xs[i] = xs[i]
 *         _ys[i] = ys[i]             # <<<<<<<<<<<<<<
 *     s.xs = _xs
 *     s.ys = _ys
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ys, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2757, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v__ys[__pyx_v_i]) = __pyx_t_5;
  }

  /* "bpf4/core.pyx":2758
 *         _xs[i] = xs[i]
 *         _ys[i] = ys[i]
 *     s.xs = _xs             # <<<<<<<<<<<<<<
 *     s.ys = _ys
 *     s.low_slope = low_slope
 */
  __pyx_v_s->xs = __pyx_v__xs;

  /* "bpf4/core.pyx":2759
 *         _ys[i] = ys[i]
 *     s.xs = _xs
 *     s.ys = _ys             # <<<<<<<<<<<<<<
 *     s.low_slope = low_slope
 *     s.high_slope = high_slope
 */
  __pyx_v_s->ys = __pyx_v__ys;

  /* "bpf4/core.pyx":2760
 *     s.xs = _xs
 *     s.ys = _ys
 *     s.low_slope = low_slope             # <<<<<<<<<<<<<<
 *     s.high_slope = high_slope
 *     s.use_low_slope = use_low_slope
 */
  __pyx_v_s->low_slope = __pyx_v_low_slope;

  /* "bpf4/core.pyx":2761
 *     s.ys = _ys
 *     s.low_slope = low_slope
 *     s.high_slope = high_slope             # <<<<<<<<<<<<<<
 *     s.use_low_slope = use_low_slope
 *     s.use_high_slope = use_high_slope
 */
  __pyx_v_s->high_slope = __pyx_v_high_slope;

  /* "bpf4/core.pyx":2762
 *     s.low_slope = low_slope
 *     s.high_slope = high_slope
 *     s.use_low_slope = use_low_slope             # <<<<<<<<<<<<<<
 *     s.use_high_slope = use_high_slope
 *     s.last_index = length - 1
 */
  __pyx_v_s->use_low_slope = __pyx_v_use_low_slope;

  /* "bpf4/core.pyx":2763
 *     s.high_slope = high_slope
 *     s.use_low_slope = use_low_slope
 *     s.use_high_slope = use_high_slope             # <<<<<<<<<<<<<<
 *     s.last_index = length - 1
 *     s.length = length
 */
  __pyx_v_s->use_high_slope = __pyx_v_use_high_slope;

  /* "bpf4/core.pyx":2764
 *     s.use_low_slope = use_low_slope
 *     s.use_high_slope = use_high_slope
 *     s.last_index = length - 1             # <<<<<<<<<<<<<<
 *     s.length = length
 *     SplineS_calc_ypp(s)
 */
  __pyx_v_s->last_index = (__pyx_v_length - 1);

  /* "bpf4/core.pyx":2765
 *     s.use_high_slope = use_high_slope
 *     s.last_index = length - 1
 *     s.length = length             # <<<<<<<<<<<<<<
 *     SplineS_calc_ypp(s)
 *     return s
 */
  __pyx_v_s->length = __pyx_v_length;

  /* "bpf4/core.pyx":2766
 *     s.last_index = length - 1
 *     s.length = length
 *     SplineS_calc_ypp(s)             # <<<<<<<<<<<<<<
 *     return s
 * 
 */
  __pyx_f_4bpf4_4core_SplineS_calc_ypp(__pyx_v_s);

  /* "bpf4/core.pyx":2767
 *     s.length = length
 *     SplineS_calc_ypp(s)
 *     return s             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2749
 * 
 * 
 * cdef SplineS* SplineS_new(xs, ys, Py_ssize_t xs_size, double low_slope=0, double high_slope=0, int use_low_slope=0, int use_high_slope=0):             # <<<<<<<<<<<<<<
 *     cdef SplineS *s = <SplineS *>malloc(sizeof(SplineS))
 *     cdef int length = xs_size
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("bpf4.core.SplineS_new", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2770
 * 
 * 
 * cdef void SplineS_destroy(SplineS *self):             # <<<<<<<<<<<<<<
 *     free(self.xs)
 *     free(self.ys)
 */

static void __pyx_f_4bpf4_4core_SplineS_destroy(__pyx_t_4bpf4_4core_SplineS *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SplineS_destroy", 0);

  /* "bpf4/core.pyx":2771
 * 
 * cdef void SplineS_destroy(SplineS *self):
 *     free(self.xs)             # <<<<<<<<<<<<<<
 *     free(self.ys)
 *     free(self.ys2)
 */
  free(__pyx_v_self->xs);

  /* "bpf4/core.pyx":2772
 * cdef void SplineS_destroy(SplineS *self):
 *     free(self.xs)
 *     free(self.ys)             # <<<<<<<<<<<<<<
 *     free(self.ys2)
 * 
 */
  free(__pyx_v_self->ys);

  /* "bpf4/core.pyx":2773
 *     free(self.xs)
 *     free(self.ys)
 *     free(self.ys2)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  free(__pyx_v_self->ys2);

  /* "bpf4/core.pyx":2770
 * 
 * 
 * cdef void SplineS_destroy(SplineS *self):             # <<<<<<<<<<<<<<
 *     free(self.xs)
 *     free(self.ys)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":2778
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cdef void SplineS_calc_ypp(SplineS *self) nogil:             # <<<<<<<<<<<<<<
 *     cdef DTYPE_t *x_vals = self.xs
 *     cdef DTYPE_t *y_vals = self.ys
 */

static void __pyx_f_4bpf4_4core_SplineS_calc_ypp(__pyx_t_4bpf4_4core_SplineS *__pyx_v_self) {
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_x_vals;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_y_vals;
  int __pyx_v_n;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_y2_vals;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_u;
  double __pyx_v_x1_minus_x0;
  double __pyx_v_denom;
  double __pyx_v_sig;
  double __pyx_v_p;
  double __pyx_v_qn;
  double __pyx_v_un;
  int __pyx_v_i;
  int __pyx_v_k;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  long __pyx_t_5;
  long __pyx_t_6;

  /* "bpf4/core.pyx":2779
 * @cython.cdivision(True)
 * cdef void SplineS_calc_ypp(SplineS *self) nogil:
 *     cdef DTYPE_t *x_vals = self.xs             # <<<<<<<<<<<<<<
 *     cdef DTYPE_t *y_vals = self.ys
 *     cdef int n = self.length
 */
  __pyx_t_1 = __pyx_v_self->xs;
  __pyx_v_x_vals = __pyx_t_1;

  /* "bpf4/core.pyx":2780
 * cdef void SplineS_calc_ypp(SplineS *self) nogil:
 *     cdef DTYPE_t *x_vals = self.xs
 *     cdef DTYPE_t *y_vals = self.ys             # <<<<<<<<<<<<<<
 *     cdef int n = self.length
 *     cdef DTYPE_t *y2_vals = <DTYPE_t *>malloc(sizeof(DTYPE_t) * n)
 */
  __pyx_t_1 = __pyx_v_self->ys;
  __pyx_v_y_vals = __pyx_t_1;

  /* "bpf4/core.pyx":2781
 *     cdef DTYPE_t *x_vals = self.xs
 *     cdef DTYPE_t *y_vals = self.ys
 *     cdef int n = self.length             # <<<<<<<<<<<<<<
 *     cdef DTYPE_t *y2_vals = <DTYPE_t *>malloc(sizeof(DTYPE_t) * n)
 *     cdef DTYPE_t *u =       <DTYPE_t *>malloc(sizeof(DTYPE_t) * (n - 1))  # this is a temporary array
 */
  __pyx_t_2 = __pyx_v_self->length;
  __pyx_v_n = __pyx_t_2;

  /* "bpf4/core.pyx":2782
 *     cdef DTYPE_t *y_vals = self.ys
 *     cdef int n = self.length
 *     cdef DTYPE_t *y2_vals = <DTYPE_t *>malloc(sizeof(DTYPE_t) * n)             # <<<<<<<<<<<<<<
 *     cdef DTYPE_t *u =       <DTYPE_t *>malloc(sizeof(DTYPE_t) * (n - 1))  # this is a temporary array
 *     cdef double x1_minus_x0, denom, sig, p, qn, un
 */
  __pyx_v_y2_vals = ((__pyx_t_4bpf4_4core_DTYPE_t *)malloc(((sizeof(__pyx_t_4bpf4_4core_DTYPE_t)) * __pyx_v_n)));

  /* "bpf4/core.pyx":2783
 *     cdef int n = self.length
 *     cdef DTYPE_t *y2_vals = <DTYPE_t *>malloc(sizeof(DTYPE_t) * n)
 *     cdef DTYPE_t *u =       <DTYPE_t *>malloc(sizeof(DTYPE_t) * (n - 1))  # this is a temporary array             # <<<<<<<<<<<<<<
 *     cdef double x1_minus_x0, denom, sig, p, qn, un
 *     cdef int i, k
 */
  __pyx_v_u = ((__pyx_t_4bpf4_4core_DTYPE_t *)malloc(((sizeof(__pyx_t_4bpf4_4core_DTYPE_t)) * (__pyx_v_n - 1))));

  /* "bpf4/core.pyx":2786
 *     cdef double x1_minus_x0, denom, sig, p, qn, un
 *     cdef int i, k
 *     if self.use_low_slope == 1:             # <<<<<<<<<<<<<<
 *         x1_minus_x0 = x_vals[1] - x_vals[0]
 *         # u[0] = (3.0/(x_vals[1]-x_vals[0])) * ((y_vals[1]-y_vals[0]) / (x_vals[1]-x_vals[0])-self.low_slope)
 */
  __pyx_t_3 = ((__pyx_v_self->use_low_slope == 1) != 0);
  if (__pyx_t_3) {

    /* "bpf4/core.pyx":2787
 *     cdef int i, k
 *     if self.use_low_slope == 1:
 *         x1_minus_x0 = x_vals[1] - x_vals[0]             # <<<<<<<<<<<<<<
 *         # u[0] = (3.0/(x_vals[1]-x_vals[0])) * ((y_vals[1]-y_vals[0]) / (x_vals[1]-x_vals[0])-self.low_slope)
 *         x1_minus_x0 += 1e-12
 */
    __pyx_v_x1_minus_x0 = ((__pyx_v_x_vals[1]) - (__pyx_v_x_vals[0]));

    /* "bpf4/core.pyx":2789
 *         x1_minus_x0 = x_vals[1] - x_vals[0]
 *         # u[0] = (3.0/(x_vals[1]-x_vals[0])) * ((y_vals[1]-y_vals[0]) / (x_vals[1]-x_vals[0])-self.low_slope)
 *         x1_minus_x0 += 1e-12             # <<<<<<<<<<<<<<
 *         u[0] =(3.0 / x1_minus_x0) * ( (y_vals[1]-y_vals[0]) / x1_minus_x0 - self.low_slope)
 *         y2_vals[0] = -0.5
 */
    __pyx_v_x1_minus_x0 = (__pyx_v_x1_minus_x0 + 1e-12);

    /* "bpf4/core.pyx":2790
 *         # u[0] = (3.0/(x_vals[1]-x_vals[0])) * ((y_vals[1]-y_vals[0]) / (x_vals[1]-x_vals[0])-self.low_slope)
 *         x1_minus_x0 += 1e-12
 *         u[0] =(3.0 / x1_minus_x0) * ( (y_vals[1]-y_vals[0]) / x1_minus_x0 - self.low_slope)             # <<<<<<<<<<<<<<
 *         y2_vals[0] = -0.5
 *     else:
 */
    (__pyx_v_u[0]) = ((3.0 / __pyx_v_x1_minus_x0) * ((((__pyx_v_y_vals[1]) - (__pyx_v_y_vals[0])) / ((__pyx_t_4bpf4_4core_DTYPE_t)__pyx_v_x1_minus_x0)) - __pyx_v_self->low_slope));

    /* "bpf4/core.pyx":2791
 *         x1_minus_x0 += 1e-12
 *         u[0] =(3.0 / x1_minus_x0) * ( (y_vals[1]-y_vals[0]) / x1_minus_x0 - self.low_slope)
 *         y2_vals[0] = -0.5             # <<<<<<<<<<<<<<
 *     else:
 *         u[0] = 0.0
 */
    (__pyx_v_y2_vals[0]) = -0.5;

    /* "bpf4/core.pyx":2786
 *     cdef double x1_minus_x0, denom, sig, p, qn, un
 *     cdef int i, k
 *     if self.use_low_slope == 1:             # <<<<<<<<<<<<<<
 *         x1_minus_x0 = x_vals[1] - x_vals[0]
 *         # u[0] = (3.0/(x_vals[1]-x_vals[0])) * ((y_vals[1]-y_vals[0]) / (x_vals[1]-x_vals[0])-self.low_slope)
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2793
 *         y2_vals[0] = -0.5
 *     else:
 *         u[0] = 0.0             # <<<<<<<<<<<<<<
 *         y2_vals[0] = 0.0   # natural spline
 *     for i in range(1, n-1):
 */
  /*else*/ {
    (__pyx_v_u[0]) = 0.0;

    /* "bpf4/core.pyx":2794
 *     else:
 *         u[0] = 0.0
 *         y2_vals[0] = 0.0   # natural spline             # <<<<<<<<<<<<<<
 *     for i in range(1, n-1):
 *         denom = x_vals[i+1] - x_vals[i-1] + 1e-12
 */
    (__pyx_v_y2_vals[0]) = 0.0;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":2795
 *         u[0] = 0.0
 *         y2_vals[0] = 0.0   # natural spline
 *     for i in range(1, n-1):             # <<<<<<<<<<<<<<
 *         denom = x_vals[i+1] - x_vals[i-1] + 1e-12
 *         sig = (x_vals[i]-x_vals[i-1]) / denom
 */
  __pyx_t_4 = (__pyx_v_n - 1);
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_2 = 1; __pyx_t_2 < __pyx_t_5; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "bpf4/core.pyx":2796
 *         y2_vals[0] = 0.0   # natural spline
 *     for i in range(1, n-1):
 *         denom = x_vals[i+1] - x_vals[i-1] + 1e-12             # <<<<<<<<<<<<<<
 *         sig = (x_vals[i]-x_vals[i-1]) / denom
 *         p = sig*y2_vals[i-1]+2.0
 */
    __pyx_v_denom = (((__pyx_v_x_vals[(__pyx_v_i + 1)]) - (__pyx_v_x_vals[(__pyx_v_i - 1)])) + 1e-12);

    /* "bpf4/core.pyx":2797
 *     for i in range(1, n-1):
 *         denom = x_vals[i+1] - x_vals[i-1] + 1e-12
 *         sig = (x_vals[i]-x_vals[i-1]) / denom             # <<<<<<<<<<<<<<
 *         p = sig*y2_vals[i-1]+2.0
 *         y2_vals[i] = (sig-1.0)/p
 */
    __pyx_v_sig = (((__pyx_v_x_vals[__pyx_v_i]) - (__pyx_v_x_vals[(__pyx_v_i - 1)])) / ((__pyx_t_4bpf4_4core_DTYPE_t)__pyx_v_denom));

    /* "bpf4/core.pyx":2798
 *         denom = x_vals[i+1] - x_vals[i-1] + 1e-12
 *         sig = (x_vals[i]-x_vals[i-1]) / denom
 *         p = sig*y2_vals[i-1]+2.0             # <<<<<<<<<<<<<<
 *         y2_vals[i] = (sig-1.0)/p
 *         if x_vals[i+1] == x_vals[i]:
 */
    __pyx_v_p = ((__pyx_v_sig * (__pyx_v_y2_vals[(__pyx_v_i - 1)])) + 2.0);

    /* "bpf4/core.pyx":2799
 *         sig = (x_vals[i]-x_vals[i-1]) / denom
 *         p = sig*y2_vals[i-1]+2.0
 *         y2_vals[i] = (sig-1.0)/p             # <<<<<<<<<<<<<<
 *         if x_vals[i+1] == x_vals[i]:
 *             x_vals[i+1] += 1e-12
 */
    (__pyx_v_y2_vals[__pyx_v_i]) = ((__pyx_v_sig - 1.0) / __pyx_v_p);

    /* "bpf4/core.pyx":2800
 *         p = sig*y2_vals[i-1]+2.0
 *         y2_vals[i] = (sig-1.0)/p
 *         if x_vals[i+1] == x_vals[i]:             # <<<<<<<<<<<<<<
 *             x_vals[i+1] += 1e-12
 *         u[i] = (y_vals[i+1]-y_vals[i]) / (x_vals[i+1]-x_vals[i]) - (y_vals[i]-y_vals[i-1]) / (x_vals[i]-x_vals[i-1])
 */
    __pyx_t_3 = (((__pyx_v_x_vals[(__pyx_v_i + 1)]) == (__pyx_v_x_vals[__pyx_v_i])) != 0);
    if (__pyx_t_3) {

      /* "bpf4/core.pyx":2801
 *         y2_vals[i] = (sig-1.0)/p
 *         if x_vals[i+1] == x_vals[i]:
 *             x_vals[i+1] += 1e-12             # <<<<<<<<<<<<<<
 *         u[i] = (y_vals[i+1]-y_vals[i]) / (x_vals[i+1]-x_vals[i]) - (y_vals[i]-y_vals[i-1]) / (x_vals[i]-x_vals[i-1])
 *         u[i] = (6.0 * u[i] / denom - sig * u[i-1]) / p
 */
      __pyx_t_6 = (__pyx_v_i + 1);
      (__pyx_v_x_vals[__pyx_t_6]) = ((__pyx_v_x_vals[__pyx_t_6]) + 1e-12);

      /* "bpf4/core.pyx":2800
 *         p = sig*y2_vals[i-1]+2.0
 *         y2_vals[i] = (sig-1.0)/p
 *         if x_vals[i+1] == x_vals[i]:             # <<<<<<<<<<<<<<
 *             x_vals[i+1] += 1e-12
 *         u[i] = (y_vals[i+1]-y_vals[i]) / (x_vals[i+1]-x_vals[i]) - (y_vals[i]-y_vals[i-1]) / (x_vals[i]-x_vals[i-1])
 */
    }

    /* "bpf4/core.pyx":2802
 *         if x_vals[i+1] == x_vals[i]:
 *             x_vals[i+1] += 1e-12
 *         u[i] = (y_vals[i+1]-y_vals[i]) / (x_vals[i+1]-x_vals[i]) - (y_vals[i]-y_vals[i-1]) / (x_vals[i]-x_vals[i-1])             # <<<<<<<<<<<<<<
 *         u[i] = (6.0 * u[i] / denom - sig * u[i-1]) / p
 *     if self.use_high_slope == 1:
 */
    (__pyx_v_u[__pyx_v_i]) = ((((__pyx_v_y_vals[(__pyx_v_i + 1)]) - (__pyx_v_y_vals[__pyx_v_i])) / ((__pyx_v_x_vals[(__pyx_v_i + 1)]) - (__pyx_v_x_vals[__pyx_v_i]))) - (((__pyx_v_y_vals[__pyx_v_i]) - (__pyx_v_y_vals[(__pyx_v_i - 1)])) / ((__pyx_v_x_vals[__pyx_v_i]) - (__pyx_v_x_vals[(__pyx_v_i - 1)]))));

    /* "bpf4/core.pyx":2803
 *             x_vals[i+1] += 1e-12
 *         u[i] = (y_vals[i+1]-y_vals[i]) / (x_vals[i+1]-x_vals[i]) - (y_vals[i]-y_vals[i-1]) / (x_vals[i]-x_vals[i-1])
 *         u[i] = (6.0 * u[i] / denom - sig * u[i-1]) / p             # <<<<<<<<<<<<<<
 *     if self.use_high_slope == 1:
 *         qn = 0.5
 */
    (__pyx_v_u[__pyx_v_i]) = ((((6.0 * (__pyx_v_u[__pyx_v_i])) / ((__pyx_t_4bpf4_4core_DTYPE_t)__pyx_v_denom)) - (__pyx_v_sig * (__pyx_v_u[(__pyx_v_i - 1)]))) / ((__pyx_t_4bpf4_4core_DTYPE_t)__pyx_v_p));
  }

  /* "bpf4/core.pyx":2804
 *         u[i] = (y_vals[i+1]-y_vals[i]) / (x_vals[i+1]-x_vals[i]) - (y_vals[i]-y_vals[i-1]) / (x_vals[i]-x_vals[i-1])
 *         u[i] = (6.0 * u[i] / denom - sig * u[i-1]) / p
 *     if self.use_high_slope == 1:             # <<<<<<<<<<<<<<
 *         qn = 0.5
 *         un = (3.0/(x_vals[n-1]-x_vals[n-2])) * (self.high_slope - (y_vals[n-1]-y_vals[n-2]) / (x_vals[n-1]-x_vals[n-2]))
 */
  __pyx_t_3 = ((__pyx_v_self->use_high_slope == 1) != 0);
  if (__pyx_t_3) {

    /* "bpf4/core.pyx":2805
 *         u[i] = (6.0 * u[i] / denom - sig * u[i-1]) / p
 *     if self.use_high_slope == 1:
 *         qn = 0.5             # <<<<<<<<<<<<<<
 *         un = (3.0/(x_vals[n-1]-x_vals[n-2])) * (self.high_slope - (y_vals[n-1]-y_vals[n-2]) / (x_vals[n-1]-x_vals[n-2]))
 *     else:
 */
    __pyx_v_qn = 0.5;

    /* "bpf4/core.pyx":2806
 *     if self.use_high_slope == 1:
 *         qn = 0.5
 *         un = (3.0/(x_vals[n-1]-x_vals[n-2])) * (self.high_slope - (y_vals[n-1]-y_vals[n-2]) / (x_vals[n-1]-x_vals[n-2]))             # <<<<<<<<<<<<<<
 *     else:
 *         qn = 0.0
 */
    __pyx_v_un = ((((__pyx_t_4bpf4_4core_DTYPE_t)3.0) / ((__pyx_v_x_vals[(__pyx_v_n - 1)]) - (__pyx_v_x_vals[(__pyx_v_n - 2)]))) * (__pyx_v_self->high_slope - (((__pyx_v_y_vals[(__pyx_v_n - 1)]) - (__pyx_v_y_vals[(__pyx_v_n - 2)])) / ((__pyx_v_x_vals[(__pyx_v_n - 1)]) - (__pyx_v_x_vals[(__pyx_v_n - 2)])))));

    /* "bpf4/core.pyx":2804
 *         u[i] = (y_vals[i+1]-y_vals[i]) / (x_vals[i+1]-x_vals[i]) - (y_vals[i]-y_vals[i-1]) / (x_vals[i]-x_vals[i-1])
 *         u[i] = (6.0 * u[i] / denom - sig * u[i-1]) / p
 *     if self.use_high_slope == 1:             # <<<<<<<<<<<<<<
 *         qn = 0.5
 *         un = (3.0/(x_vals[n-1]-x_vals[n-2])) * (self.high_slope - (y_vals[n-1]-y_vals[n-2]) / (x_vals[n-1]-x_vals[n-2]))
 */
    goto __pyx_L7;
  }

  /* "bpf4/core.pyx":2808
 *         un = (3.0/(x_vals[n-1]-x_vals[n-2])) * (self.high_slope - (y_vals[n-1]-y_vals[n-2]) / (x_vals[n-1]-x_vals[n-2]))
 *     else:
 *         qn = 0.0             # <<<<<<<<<<<<<<
 *         un = 0.0    # natural spline
 *     y2_vals[n-1] = (un-qn*u[n-2])/(qn*y2_vals[n-1]+1.0)
 */
  /*else*/ {
    __pyx_v_qn = 0.0;

    /* "bpf4/core.pyx":2809
 *     else:
 *         qn = 0.0
 *         un = 0.0    # natural spline             # <<<<<<<<<<<<<<
 *     y2_vals[n-1] = (un-qn*u[n-2])/(qn*y2_vals[n-1]+1.0)
 *     for k in range(n-2, -1, -1):
 */
    __pyx_v_un = 0.0;
  }
  __pyx_L7:;

  /* "bpf4/core.pyx":2810
 *         qn = 0.0
 *         un = 0.0    # natural spline
 *     y2_vals[n-1] = (un-qn*u[n-2])/(qn*y2_vals[n-1]+1.0)             # <<<<<<<<<<<<<<
 *     for k in range(n-2, -1, -1):
 *         y2_vals[k] = y2_vals[k]*y2_vals[k+1]+u[k]
 */
  (__pyx_v_y2_vals[(__pyx_v_n - 1)]) = ((__pyx_v_un - (__pyx_v_qn * (__pyx_v_u[(__pyx_v_n - 2)]))) / ((__pyx_v_qn * (__pyx_v_y2_vals[(__pyx_v_n - 1)])) + 1.0));

  /* "bpf4/core.pyx":2811
 *         un = 0.0    # natural spline
 *     y2_vals[n-1] = (un-qn*u[n-2])/(qn*y2_vals[n-1]+1.0)
 *     for k in range(n-2, -1, -1):             # <<<<<<<<<<<<<<
 *         y2_vals[k] = y2_vals[k]*y2_vals[k+1]+u[k]
 *     free(u)
 */
  for (__pyx_t_2 = (__pyx_v_n - 2); __pyx_t_2 > -1; __pyx_t_2-=1) {
    __pyx_v_k = __pyx_t_2;

    /* "bpf4/core.pyx":2812
 *     y2_vals[n-1] = (un-qn*u[n-2])/(qn*y2_vals[n-1]+1.0)
 *     for k in range(n-2, -1, -1):
 *         y2_vals[k] = y2_vals[k]*y2_vals[k+1]+u[k]             # <<<<<<<<<<<<<<
 *     free(u)
 *     self.ys2 = y2_vals
 */
    (__pyx_v_y2_vals[__pyx_v_k]) = (((__pyx_v_y2_vals[__pyx_v_k]) * (__pyx_v_y2_vals[(__pyx_v_k + 1)])) + (__pyx_v_u[__pyx_v_k]));
  }

  /* "bpf4/core.pyx":2813
 *     for k in range(n-2, -1, -1):
 *         y2_vals[k] = y2_vals[k]*y2_vals[k+1]+u[k]
 *     free(u)             # <<<<<<<<<<<<<<
 *     self.ys2 = y2_vals
 * 
 */
  free(__pyx_v_u);

  /* "bpf4/core.pyx":2814
 *         y2_vals[k] = y2_vals[k]*y2_vals[k+1]+u[k]
 *     free(u)
 *     self.ys2 = y2_vals             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->ys2 = __pyx_v_y2_vals;

  /* "bpf4/core.pyx":2778
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cdef void SplineS_calc_ypp(SplineS *self) nogil:             # <<<<<<<<<<<<<<
 *     cdef DTYPE_t *x_vals = self.xs
 *     cdef DTYPE_t *y_vals = self.ys
 */

  /* function exit code */
}

/* "bpf4/core.pyx":2819
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cdef inline double SplineS_at(SplineS *self, double x) nogil:             # <<<<<<<<<<<<<<
 *     # if out of range, return endpoint
 *     cdef double a, b, out
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core_SplineS_at(__pyx_t_4bpf4_4core_SplineS *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_a;
  double __pyx_v_b;
  double __pyx_v_out;
  int __pyx_v_pos;
  double __pyx_v_h;
  double __pyx_r;
  int __pyx_t_1;

  /* "bpf4/core.pyx":2822
 *     # if out of range, return endpoint
 *     cdef double a, b, out
 *     if x <= self.xs[0]:             # <<<<<<<<<<<<<<
 *         return self.ys[0]
 *     if x >= self.xs[self.last_index]:
 */
  __pyx_t_1 = ((__pyx_v_x <= (__pyx_v_self->xs[0])) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":2823
 *     cdef double a, b, out
 *     if x <= self.xs[0]:
 *         return self.ys[0]             # <<<<<<<<<<<<<<
 *     if x >= self.xs[self.last_index]:
 *         return self.ys[self.last_index]
 */
    __pyx_r = (__pyx_v_self->ys[0]);
    goto __pyx_L0;

    /* "bpf4/core.pyx":2822
 *     # if out of range, return endpoint
 *     cdef double a, b, out
 *     if x <= self.xs[0]:             # <<<<<<<<<<<<<<
 *         return self.ys[0]
 *     if x >= self.xs[self.last_index]:
 */
  }

  /* "bpf4/core.pyx":2824
 *     if x <= self.xs[0]:
 *         return self.ys[0]
 *     if x >= self.xs[self.last_index]:             # <<<<<<<<<<<<<<
 *         return self.ys[self.last_index]
 *     cdef int pos = _csearchsorted(self.xs, self.length, x)
 */
  __pyx_t_1 = ((__pyx_v_x >= (__pyx_v_self->xs[__pyx_v_self->last_index])) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":2825
 *         return self.ys[0]
 *     if x >= self.xs[self.last_index]:
 *         return self.ys[self.last_index]             # <<<<<<<<<<<<<<
 *     cdef int pos = _csearchsorted(self.xs, self.length, x)
 *     cdef double h = self.xs[pos] - self.xs[pos-1]
 */
    __pyx_r = (__pyx_v_self->ys[__pyx_v_self->last_index]);
    goto __pyx_L0;

    /* "bpf4/core.pyx":2824
 *     if x <= self.xs[0]:
 *         return self.ys[0]
 *     if x >= self.xs[self.last_index]:             # <<<<<<<<<<<<<<
 *         return self.ys[self.last_index]
 *     cdef int pos = _csearchsorted(self.xs, self.length, x)
 */
  }

  /* "bpf4/core.pyx":2826
 *     if x >= self.xs[self.last_index]:
 *         return self.ys[self.last_index]
 *     cdef int pos = _csearchsorted(self.xs, self.length, x)             # <<<<<<<<<<<<<<
 *     cdef double h = self.xs[pos] - self.xs[pos-1]
 *     if h == 0.0:
 */
  __pyx_v_pos = __pyx_f_4bpf4_4core__csearchsorted(__pyx_v_self->xs, __pyx_v_self->length, __pyx_v_x);

  /* "bpf4/core.pyx":2827
 *         return self.ys[self.last_index]
 *     cdef int pos = _csearchsorted(self.xs, self.length, x)
 *     cdef double h = self.xs[pos] - self.xs[pos-1]             # <<<<<<<<<<<<<<
 *     if h == 0.0:
 *         out = INFINITY
 */
  __pyx_v_h = ((__pyx_v_self->xs[__pyx_v_pos]) - (__pyx_v_self->xs[(__pyx_v_pos - 1)]));

  /* "bpf4/core.pyx":2828
 *     cdef int pos = _csearchsorted(self.xs, self.length, x)
 *     cdef double h = self.xs[pos] - self.xs[pos-1]
 *     if h == 0.0:             # <<<<<<<<<<<<<<
 *         out = INFINITY
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_h == 0.0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":2829
 *     cdef double h = self.xs[pos] - self.xs[pos-1]
 *     if h == 0.0:
 *         out = INFINITY             # <<<<<<<<<<<<<<
 *     else:
 *         a = (self.xs[pos] - x) / h
 */
    __pyx_v_out = INFINITY;

    /* "bpf4/core.pyx":2828
 *     cdef int pos = _csearchsorted(self.xs, self.length, x)
 *     cdef double h = self.xs[pos] - self.xs[pos-1]
 *     if h == 0.0:             # <<<<<<<<<<<<<<
 *         out = INFINITY
 *     else:
 */
    goto __pyx_L5;
  }

  /* "bpf4/core.pyx":2831
 *         out = INFINITY
 *     else:
 *         a = (self.xs[pos] - x) / h             # <<<<<<<<<<<<<<
 *         b = (x - self.xs[pos-1]) / h
 *         out = (a* self.ys[pos-1] + b*self.ys[pos] + \
 */
  /*else*/ {
    __pyx_v_a = (((__pyx_v_self->xs[__pyx_v_pos]) - __pyx_v_x) / ((__pyx_t_4bpf4_4core_DTYPE_t)__pyx_v_h));

    /* "bpf4/core.pyx":2832
 *     else:
 *         a = (self.xs[pos] - x) / h
 *         b = (x - self.xs[pos-1]) / h             # <<<<<<<<<<<<<<
 *         out = (a* self.ys[pos-1] + b*self.ys[pos] + \
 *               ((a*a*a - a)*self.ys2[pos-1] + \
 */
    __pyx_v_b = ((__pyx_v_x - (__pyx_v_self->xs[(__pyx_v_pos - 1)])) / ((__pyx_t_4bpf4_4core_DTYPE_t)__pyx_v_h));

    /* "bpf4/core.pyx":2833
 *         a = (self.xs[pos] - x) / h
 *         b = (x - self.xs[pos-1]) / h
 *         out = (a* self.ys[pos-1] + b*self.ys[pos] + \             # <<<<<<<<<<<<<<
 *               ((a*a*a - a)*self.ys2[pos-1] + \
 *               (b*b*b - b)*self.ys2[pos]) * h*h/6.0)
 */
    __pyx_v_out = (((__pyx_v_a * (__pyx_v_self->ys[(__pyx_v_pos - 1)])) + (__pyx_v_b * (__pyx_v_self->ys[__pyx_v_pos]))) + ((((((((__pyx_v_a * __pyx_v_a) * __pyx_v_a) - __pyx_v_a) * (__pyx_v_self->ys2[(__pyx_v_pos - 1)])) + ((((__pyx_v_b * __pyx_v_b) * __pyx_v_b) - __pyx_v_b) * (__pyx_v_self->ys2[__pyx_v_pos]))) * __pyx_v_h) * __pyx_v_h) / ((__pyx_t_4bpf4_4core_DTYPE_t)6.0)));
  }
  __pyx_L5:;

  /* "bpf4/core.pyx":2836
 *               ((a*a*a - a)*self.ys2[pos-1] + \
 *               (b*b*b - b)*self.ys2[pos]) * h*h/6.0)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2819
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cdef inline double SplineS_at(SplineS *self, double x) nogil:             # <<<<<<<<<<<<<<
 *     # if out of range, return endpoint
 *     cdef double a, b, out
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":2856
 *     cdef ndarray _cached_xs
 * 
 *     def __init__(self, samples, double dx, double x0=0, str interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_7Sampled_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled___init__[] = "\n        Args:\n            samples (ndarray): the y-coord sampled data\n            dx (float): the sampling **period**\n            x0 (float): the first x-value\n            interpolation (str): the interpolation function used. One of 'linear',\n                'nointerpol', 'expon(X)', 'halfcos', 'halfcos(X)', 'smooth',\n                'halfcosm', etc.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_7Sampled___init__;
#endif
static int __pyx_pw_4bpf4_4core_7Sampled_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_samples = 0;
  double __pyx_v_dx;
  double __pyx_v_x0;
  PyObject *__pyx_v_interpolation = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samples,&__pyx_n_s_dx,&__pyx_n_s_x0,&__pyx_n_s_interpolation,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject*)__pyx_n_u_linear);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 2856, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolation);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2856, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_samples = values[0];
    __pyx_v_dx = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2856, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2856, __pyx_L3_error)
    } else {
      __pyx_v_x0 = ((double)0.0);
    }
    __pyx_v_interpolation = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2856, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Sampled.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolation), (&PyUnicode_Type), 1, "interpolation", 1))) __PYX_ERR(0, 2856, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled___init__(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self), __pyx_v_samples, __pyx_v_dx, __pyx_v_x0, __pyx_v_interpolation);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_7Sampled___init__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, PyObject *__pyx_v_samples, double __pyx_v_dx, double __pyx_v_x0, PyObject *__pyx_v_interpolation) {
  npy_intp __pyx_v_l;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":2866
 *                 'halfcosm', etc.
 *         """
 *         self.ys = numpy.ascontiguousarray(samples, dtype=DTYPE)             # <<<<<<<<<<<<<<
 *         self.data = <DTYPE_t *>self.ys.data
 *         l = PyArray_DIM(self.ys, 0)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_samples);
  __Pyx_GIVEREF(__pyx_v_samples);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_samples);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 2866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __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;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2866, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->ys);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->ys));
  __pyx_v_self->ys = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "bpf4/core.pyx":2867
 *         """
 *         self.ys = numpy.ascontiguousarray(samples, dtype=DTYPE)
 *         self.data = <DTYPE_t *>self.ys.data             # <<<<<<<<<<<<<<
 *         l = PyArray_DIM(self.ys, 0)
 *         self.samples_size = l
 */
  __pyx_v_self->data = ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_self->ys->data);

  /* "bpf4/core.pyx":2868
 *         self.ys = numpy.ascontiguousarray(samples, dtype=DTYPE)
 *         self.data = <DTYPE_t *>self.ys.data
 *         l = PyArray_DIM(self.ys, 0)             # <<<<<<<<<<<<<<
 *         self.samples_size = l
 *         self.grid_x0 = x0
 */
  __pyx_t_4 = ((PyObject *)__pyx_v_self->ys);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_l = PyArray_DIM(((PyArrayObject *)__pyx_t_4), 0);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "bpf4/core.pyx":2869
 *         self.data = <DTYPE_t *>self.ys.data
 *         l = PyArray_DIM(self.ys, 0)
 *         self.samples_size = l             # <<<<<<<<<<<<<<
 *         self.grid_x0 = x0
 *         self.grid_dx = dx
 */
  __pyx_v_self->samples_size = __pyx_v_l;

  /* "bpf4/core.pyx":2870
 *         l = PyArray_DIM(self.ys, 0)
 *         self.samples_size = l
 *         self.grid_x0 = x0             # <<<<<<<<<<<<<<
 *         self.grid_dx = dx
 *         self.grid_x1 = x0 + dx * (l - 1)
 */
  __pyx_v_self->grid_x0 = __pyx_v_x0;

  /* "bpf4/core.pyx":2871
 *         self.samples_size = l
 *         self.grid_x0 = x0
 *         self.grid_dx = dx             # <<<<<<<<<<<<<<
 *         self.grid_x1 = x0 + dx * (l - 1)
 *         self._set_bounds(x0, self.grid_x1)
 */
  __pyx_v_self->grid_dx = __pyx_v_dx;

  /* "bpf4/core.pyx":2872
 *         self.grid_x0 = x0
 *         self.grid_dx = dx
 *         self.grid_x1 = x0 + dx * (l - 1)             # <<<<<<<<<<<<<<
 *         self._set_bounds(x0, self.grid_x1)
 *         self._cached_xs = None
 */
  __pyx_v_self->grid_x1 = (__pyx_v_x0 + (__pyx_v_dx * (__pyx_v_l - 1)));

  /* "bpf4/core.pyx":2873
 *         self.grid_dx = dx
 *         self.grid_x1 = x0 + dx * (l - 1)
 *         self._set_bounds(x0, self.grid_x1)             # <<<<<<<<<<<<<<
 *         self._cached_xs = None
 *         if interpolation == 'nointerpol':
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_self->grid_x1);

  /* "bpf4/core.pyx":2874
 *         self.grid_x1 = x0 + dx * (l - 1)
 *         self._set_bounds(x0, self.grid_x1)
 *         self._cached_xs = None             # <<<<<<<<<<<<<<
 *         if interpolation == 'nointerpol':
 *             self.nointerpol = 1
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_cached_xs);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_cached_xs));
  __pyx_v_self->_cached_xs = ((PyArrayObject *)Py_None);

  /* "bpf4/core.pyx":2875
 *         self._set_bounds(x0, self.grid_x1)
 *         self._cached_xs = None
 *         if interpolation == 'nointerpol':             # <<<<<<<<<<<<<<
 *             self.nointerpol = 1
 *             self.interpolfunc = NULL
 */
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_interpolation, __pyx_n_u_nointerpol, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2875, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "bpf4/core.pyx":2876
 *         self._cached_xs = None
 *         if interpolation == 'nointerpol':
 *             self.nointerpol = 1             # <<<<<<<<<<<<<<
 *             self.interpolfunc = NULL
 *         elif interpolation == 'linear':
 */
    __pyx_v_self->nointerpol = 1;

    /* "bpf4/core.pyx":2877
 *         if interpolation == 'nointerpol':
 *             self.nointerpol = 1
 *             self.interpolfunc = NULL             # <<<<<<<<<<<<<<
 *         elif interpolation == 'linear':
 *             self.nointerpol = 0
 */
    __pyx_v_self->interpolfunc = NULL;

    /* "bpf4/core.pyx":2875
 *         self._set_bounds(x0, self.grid_x1)
 *         self._cached_xs = None
 *         if interpolation == 'nointerpol':             # <<<<<<<<<<<<<<
 *             self.nointerpol = 1
 *             self.interpolfunc = NULL
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2878
 *             self.nointerpol = 1
 *             self.interpolfunc = NULL
 *         elif interpolation == 'linear':             # <<<<<<<<<<<<<<
 *             self.nointerpol = 0
 *             self.interpolfunc = InterpolFunc_linear
 */
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_interpolation, __pyx_n_u_linear, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2878, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "bpf4/core.pyx":2879
 *             self.interpolfunc = NULL
 *         elif interpolation == 'linear':
 *             self.nointerpol = 0             # <<<<<<<<<<<<<<
 *             self.interpolfunc = InterpolFunc_linear
 *         else:
 */
    __pyx_v_self->nointerpol = 0;

    /* "bpf4/core.pyx":2880
 *         elif interpolation == 'linear':
 *             self.nointerpol = 0
 *             self.interpolfunc = InterpolFunc_linear             # <<<<<<<<<<<<<<
 *         else:
 *             self.nointerpol = 0
 */
    __pyx_v_self->interpolfunc = __pyx_v_4bpf4_4core_InterpolFunc_linear;

    /* "bpf4/core.pyx":2878
 *             self.nointerpol = 1
 *             self.interpolfunc = NULL
 *         elif interpolation == 'linear':             # <<<<<<<<<<<<<<
 *             self.nointerpol = 0
 *             self.interpolfunc = InterpolFunc_linear
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2882
 *             self.interpolfunc = InterpolFunc_linear
 *         else:
 *             self.nointerpol = 0             # <<<<<<<<<<<<<<
 *             self.interpolfunc = InterpolFunc_new_from_descriptor(interpolation)
 *             if self.interpolfunc is NULL:
 */
  /*else*/ {
    __pyx_v_self->nointerpol = 0;

    /* "bpf4/core.pyx":2883
 *         else:
 *             self.nointerpol = 0
 *             self.interpolfunc = InterpolFunc_new_from_descriptor(interpolation)             # <<<<<<<<<<<<<<
 *             if self.interpolfunc is NULL:
 *                 raise ValueError("interpolation type not understood")
 */
    __pyx_v_self->interpolfunc = __pyx_f_4bpf4_4core_InterpolFunc_new_from_descriptor(__pyx_v_interpolation, NULL);

    /* "bpf4/core.pyx":2884
 *             self.nointerpol = 0
 *             self.interpolfunc = InterpolFunc_new_from_descriptor(interpolation)
 *             if self.interpolfunc is NULL:             # <<<<<<<<<<<<<<
 *                 raise ValueError("interpolation type not understood")
 *         self.y0 = self.data[0]
 */
    __pyx_t_5 = ((__pyx_v_self->interpolfunc == NULL) != 0);
    if (unlikely(__pyx_t_5)) {

      /* "bpf4/core.pyx":2885
 *             self.interpolfunc = InterpolFunc_new_from_descriptor(interpolation)
 *             if self.interpolfunc is NULL:
 *                 raise ValueError("interpolation type not understood")             # <<<<<<<<<<<<<<
 *         self.y0 = self.data[0]
 *         self.y1 = self.data[l - 1]
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 2885, __pyx_L1_error)

      /* "bpf4/core.pyx":2884
 *             self.nointerpol = 0
 *             self.interpolfunc = InterpolFunc_new_from_descriptor(interpolation)
 *             if self.interpolfunc is NULL:             # <<<<<<<<<<<<<<
 *                 raise ValueError("interpolation type not understood")
 *         self.y0 = self.data[0]
 */
    }
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":2886
 *             if self.interpolfunc is NULL:
 *                 raise ValueError("interpolation type not understood")
 *         self.y0 = self.data[0]             # <<<<<<<<<<<<<<
 *         self.y1 = self.data[l - 1]
 * 
 */
  __pyx_v_self->y0 = (__pyx_v_self->data[0]);

  /* "bpf4/core.pyx":2887
 *                 raise ValueError("interpolation type not understood")
 *         self.y0 = self.data[0]
 *         self.y1 = self.data[l - 1]             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
  __pyx_v_self->y1 = (__pyx_v_self->data[(__pyx_v_l - 1)]);

  /* "bpf4/core.pyx":2856
 *     cdef ndarray _cached_xs
 * 
 *     def __init__(self, samples, double dx, double x0=0, str interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.Sampled.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2891
 *     @cython.cdivision(True)
 *     @property
 *     def samplerate(self) -> float:             # <<<<<<<<<<<<<<
 *         """
 *         The samplerate of this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_10samplerate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_10samplerate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_10samplerate___get__(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_10samplerate___get__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bpf4/core.pyx":2895
 *         The samplerate of this bpf
 *         """
 *         return 1.0 / self.grid_dx             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble((1.0 / __pyx_v_self->grid_dx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2891
 *     @cython.cdivision(True)
 *     @property
 *     def samplerate(self) -> float:             # <<<<<<<<<<<<<<
 *         """
 *         The samplerate of this bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Sampled.samplerate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2898
 * 
 *     @property
 *     def xs(self) -> numpy.ndarray:             # <<<<<<<<<<<<<<
 *         """
 *         The x-coord array of this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_2xs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_2xs_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_2xs___get__(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_2xs___get__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bpf4/core.pyx":2902
 *         The x-coord array of this bpf
 *         """
 *         if self._cached_xs is not None:             # <<<<<<<<<<<<<<
 *             return self._cached_xs
 *         self._cached_xs = numpy.linspace(self.grid_x0, self.grid_x1, self.samples_size, endpoint=False)
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->_cached_xs) != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":2903
 *         """
 *         if self._cached_xs is not None:
 *             return self._cached_xs             # <<<<<<<<<<<<<<
 *         self._cached_xs = numpy.linspace(self.grid_x0, self.grid_x1, self.samples_size, endpoint=False)
 *         return self._cached_xs
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_self->_cached_xs));
    __pyx_r = ((PyObject *)__pyx_v_self->_cached_xs);
    goto __pyx_L0;

    /* "bpf4/core.pyx":2902
 *         The x-coord array of this bpf
 *         """
 *         if self._cached_xs is not None:             # <<<<<<<<<<<<<<
 *             return self._cached_xs
 *         self._cached_xs = numpy.linspace(self.grid_x0, self.grid_x1, self.samples_size, endpoint=False)
 */
  }

  /* "bpf4/core.pyx":2904
 *         if self._cached_xs is not None:
 *             return self._cached_xs
 *         self._cached_xs = numpy.linspace(self.grid_x0, self.grid_x1, self.samples_size, endpoint=False)             # <<<<<<<<<<<<<<
 *         return self._cached_xs
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_linspace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->grid_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->grid_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->samples_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_endpoint, Py_False) < 0) __PYX_ERR(0, 2904, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2904, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->_cached_xs);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_cached_xs));
  __pyx_v_self->_cached_xs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "bpf4/core.pyx":2905
 *             return self._cached_xs
 *         self._cached_xs = numpy.linspace(self.grid_x0, self.grid_x1, self.samples_size, endpoint=False)
 *         return self._cached_xs             # <<<<<<<<<<<<<<
 * 
 *     def points(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_cached_xs));
  __pyx_r = ((PyObject *)__pyx_v_self->_cached_xs);
  goto __pyx_L0;

  /* "bpf4/core.pyx":2898
 * 
 *     @property
 *     def xs(self) -> numpy.ndarray:             # <<<<<<<<<<<<<<
 *         """
 *         The x-coord array of this bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bpf4.core.Sampled.xs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2907
 *         return self._cached_xs
 * 
 *     def points(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple with the points defining this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_3points(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled_2points[] = "Sampled.points(self)\n\n        Returns a tuple with the points defining this bpf\n\n        Returns:\n            (tuple[ndarray, ndarray]) A tuple `(xs, ys)` where `xs` is an array\n            holding the values for the *x* coordinate, and `ys` holds the values for\n            the *y* coordinate\n\n        ## Example\n        \n        ```python\n\n        >>> b = Linear.fromseq(0, 0, 1, 100, 2, 50)\n        >>> b.points()\n        ([0, 1, 2], [0, 100, 50])\n        ```\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Sampled_3points = {"points", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_3points, METH_NOARGS, __pyx_doc_4bpf4_4core_7Sampled_2points};
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_3points(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("points (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_2points(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_2points(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("points", 0);

  /* "bpf4/core.pyx":2926
 * 
 *         """
 *         return self.xs, self.ys             # <<<<<<<<<<<<<<
 * 
 *     property interpolation:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_xs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->ys));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->ys));
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2907
 *         return self._cached_xs
 * 
 *     def points(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple with the points defining this bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core.Sampled.points", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2929
 * 
 *     property interpolation:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             """
 *             The interpolation kind of this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_13interpolation_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_13interpolation_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_13interpolation___get__(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_13interpolation___get__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bpf4/core.pyx":2933
 *             The interpolation kind of this bpf
 *             """
 *             if self.interpolfunc is not NULL:             # <<<<<<<<<<<<<<
 *                 return InterpolFunc_get_descriptor(self.interpolfunc)
 *             return 'nointerpol'
 */
  __pyx_t_1 = ((__pyx_v_self->interpolfunc != NULL) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":2934
 *             """
 *             if self.interpolfunc is not NULL:
 *                 return InterpolFunc_get_descriptor(self.interpolfunc)             # <<<<<<<<<<<<<<
 *             return 'nointerpol'
 *         def __set__(self, interpolation):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_4bpf4_4core_InterpolFunc_get_descriptor(__pyx_v_self->interpolfunc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2934, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":2933
 *             The interpolation kind of this bpf
 *             """
 *             if self.interpolfunc is not NULL:             # <<<<<<<<<<<<<<
 *                 return InterpolFunc_get_descriptor(self.interpolfunc)
 *             return 'nointerpol'
 */
  }

  /* "bpf4/core.pyx":2935
 *             if self.interpolfunc is not NULL:
 *                 return InterpolFunc_get_descriptor(self.interpolfunc)
 *             return 'nointerpol'             # <<<<<<<<<<<<<<
 *         def __set__(self, interpolation):
 *             self.set_interpolation(interpolation)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_n_u_nointerpol);
  __pyx_r = __pyx_n_u_nointerpol;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2929
 * 
 *     property interpolation:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             """
 *             The interpolation kind of this bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core.Sampled.interpolation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2936
 *                 return InterpolFunc_get_descriptor(self.interpolfunc)
 *             return 'nointerpol'
 *         def __set__(self, interpolation):             # <<<<<<<<<<<<<<
 *             self.set_interpolation(interpolation)
 * 
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_7Sampled_13interpolation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolation); /*proto*/
static int __pyx_pw_4bpf4_4core_7Sampled_13interpolation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolation) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_13interpolation_2__set__(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self), ((PyObject *)__pyx_v_interpolation));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_7Sampled_13interpolation_2__set__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, PyObject *__pyx_v_interpolation) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "bpf4/core.pyx":2937
 *             return 'nointerpol'
 *         def __set__(self, interpolation):
 *             self.set_interpolation(interpolation)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_v_interpolation))||((__pyx_v_interpolation) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_interpolation)->tp_name), 0))) __PYX_ERR(0, 2937, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_Sampled *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, ((PyObject*)__pyx_v_interpolation), 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":2936
 *                 return InterpolFunc_get_descriptor(self.interpolfunc)
 *             return 'nointerpol'
 *         def __set__(self, interpolation):             # <<<<<<<<<<<<<<
 *             self.set_interpolation(interpolation)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Sampled.interpolation.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2940
 * 
 *     @property
 *     def dx(self) -> float:             # <<<<<<<<<<<<<<
 *         """
 *         The sampling period (delta x)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_2dx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_2dx_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_2dx___get__(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_2dx___get__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bpf4/core.pyx":2944
 *         The sampling period (delta x)
 *         """
 *         return self.grid_dx             # <<<<<<<<<<<<<<
 * 
 *     cpdef Sampled set_interpolation(self, str interpolation):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->grid_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2940
 * 
 *     @property
 *     def dx(self) -> float:             # <<<<<<<<<<<<<<
 *         """
 *         The sampling period (delta x)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Sampled.dx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2946
 *         return self.grid_dx
 * 
 *     cpdef Sampled set_interpolation(self, str interpolation):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the interpolation of this Sampled bpf, inplace
 */

static PyObject *__pyx_pw_4bpf4_4core_7Sampled_5set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolation); /*proto*/
static struct __pyx_obj_4bpf4_4core_Sampled *__pyx_f_4bpf4_4core_7Sampled_set_interpolation(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, PyObject *__pyx_v_interpolation, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core_Sampled *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_7Sampled_5set_interpolation)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_interpolation) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolation);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2946, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_Sampled))))) __PYX_ERR(0, 2946, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":2964
 *         ```
 *         """
 *         InterpolFunc_free(self.interpolfunc)             # <<<<<<<<<<<<<<
 *         if interpolation == 'nointerpol':
 *             self.nointerpol = 1
 */
  __pyx_f_4bpf4_4core_InterpolFunc_free(__pyx_v_self->interpolfunc);

  /* "bpf4/core.pyx":2965
 *         """
 *         InterpolFunc_free(self.interpolfunc)
 *         if interpolation == 'nointerpol':             # <<<<<<<<<<<<<<
 *             self.nointerpol = 1
 *             self.interpolfunc = NULL
 */
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_interpolation, __pyx_n_u_nointerpol, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2965, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "bpf4/core.pyx":2966
 *         InterpolFunc_free(self.interpolfunc)
 *         if interpolation == 'nointerpol':
 *             self.nointerpol = 1             # <<<<<<<<<<<<<<
 *             self.interpolfunc = NULL
 *         else:
 */
    __pyx_v_self->nointerpol = 1;

    /* "bpf4/core.pyx":2967
 *         if interpolation == 'nointerpol':
 *             self.nointerpol = 1
 *             self.interpolfunc = NULL             # <<<<<<<<<<<<<<
 *         else:
 *             self.nointerpol = 0
 */
    __pyx_v_self->interpolfunc = NULL;

    /* "bpf4/core.pyx":2965
 *         """
 *         InterpolFunc_free(self.interpolfunc)
 *         if interpolation == 'nointerpol':             # <<<<<<<<<<<<<<
 *             self.nointerpol = 1
 *             self.interpolfunc = NULL
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2969
 *             self.interpolfunc = NULL
 *         else:
 *             self.nointerpol = 0             # <<<<<<<<<<<<<<
 *             self.interpolfunc = InterpolFunc_new_from_descriptor(interpolation)
 *         return self
 */
  /*else*/ {
    __pyx_v_self->nointerpol = 0;

    /* "bpf4/core.pyx":2970
 *         else:
 *             self.nointerpol = 0
 *             self.interpolfunc = InterpolFunc_new_from_descriptor(interpolation)             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
    __pyx_v_self->interpolfunc = __pyx_f_4bpf4_4core_InterpolFunc_new_from_descriptor(__pyx_v_interpolation, NULL);
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":2971
 *             self.nointerpol = 0
 *             self.interpolfunc = InterpolFunc_new_from_descriptor(interpolation)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2946
 *         return self.grid_dx
 * 
 *     cpdef Sampled set_interpolation(self, str interpolation):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the interpolation of this Sampled bpf, inplace
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.Sampled.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_5set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolation); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled_4set_interpolation[] = "Sampled.set_interpolation(self, unicode interpolation) -> Sampled\n\n        Sets the interpolation of this Sampled bpf, inplace\n\n        Args:\n            interpolation (str): the interpolation kind\n\n        Returns:\n            (Sampled) self\n\n        Returns *self*, so you can do:\n\n        ```python\n\n        sampled = bpf[x0:x1:dx].set_interpolation('expon(2)')\n        \n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Sampled_5set_interpolation = {"set_interpolation", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_5set_interpolation, METH_O, __pyx_doc_4bpf4_4core_7Sampled_4set_interpolation};
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_5set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolation) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolation), (&PyUnicode_Type), 1, "interpolation", 1))) __PYX_ERR(0, 2946, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_4set_interpolation(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self), ((PyObject*)__pyx_v_interpolation));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_4set_interpolation(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, PyObject *__pyx_v_interpolation) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_7Sampled_set_interpolation(__pyx_v_self, __pyx_v_interpolation, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Sampled.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2973
 *         return self
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         InterpolFunc_free(self.interpolfunc)
 * 
 */

/* Python wrapper */
static void __pyx_pw_4bpf4_4core_7Sampled_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_4bpf4_4core_7Sampled_7__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_4bpf4_4core_7Sampled_6__dealloc__(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_4bpf4_4core_7Sampled_6__dealloc__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "bpf4/core.pyx":2974
 * 
 *     def __dealloc__(self):
 *         InterpolFunc_free(self.interpolfunc)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_f_4bpf4_4core_InterpolFunc_free(__pyx_v_self->interpolfunc);

  /* "bpf4/core.pyx":2973
 *         return self
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         InterpolFunc_free(self.interpolfunc)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":2976
 *         InterpolFunc_free(self.interpolfunc)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.ys, self.grid_dx, self.grid_x0, self.interpolation)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_9__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled_8__getstate__[] = "Sampled.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Sampled_9__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_9__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_7Sampled_8__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_9__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_8__getstate__(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_8__getstate__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":2977
 * 
 *     def __getstate__(self):
 *         return (self.ys, self.grid_dx, self.grid_x0, self.interpolation)             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->grid_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->grid_x0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->ys));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->ys));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2976
 *         InterpolFunc_free(self.interpolfunc)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.ys, self.grid_dx, self.grid_x0, self.interpolation)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.Sampled.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2980
 * 
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef int index0
 *         cdef double y0, y1, x0
 */

static double __pyx_f_4bpf4_4core_7Sampled___ccall__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, double __pyx_v_x) {
  int __pyx_v_index0;
  double __pyx_v_y0;
  double __pyx_v_y1;
  double __pyx_v_x0;
  double __pyx_v_out;
  double __pyx_r;
  int __pyx_t_1;
  double __pyx_t_2;

  /* "bpf4/core.pyx":2984
 *         cdef double y0, y1, x0
 *         cdef double out
 *         if x <= self.grid_x0:             # <<<<<<<<<<<<<<
 *             out = self.y0
 *         elif x >= self.grid_x1:
 */
  __pyx_t_1 = ((__pyx_v_x <= __pyx_v_self->grid_x0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":2985
 *         cdef double out
 *         if x <= self.grid_x0:
 *             out = self.y0             # <<<<<<<<<<<<<<
 *         elif x >= self.grid_x1:
 *             out = self.y1
 */
    __pyx_t_2 = __pyx_v_self->y0;
    __pyx_v_out = __pyx_t_2;

    /* "bpf4/core.pyx":2984
 *         cdef double y0, y1, x0
 *         cdef double out
 *         if x <= self.grid_x0:             # <<<<<<<<<<<<<<
 *             out = self.y0
 *         elif x >= self.grid_x1:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2986
 *         if x <= self.grid_x0:
 *             out = self.y0
 *         elif x >= self.grid_x1:             # <<<<<<<<<<<<<<
 *             out = self.y1
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_x >= __pyx_v_self->grid_x1) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":2987
 *             out = self.y0
 *         elif x >= self.grid_x1:
 *             out = self.y1             # <<<<<<<<<<<<<<
 *         else:
 *             index0 = int((x - self.grid_x0) / self.grid_dx)
 */
    __pyx_t_2 = __pyx_v_self->y1;
    __pyx_v_out = __pyx_t_2;

    /* "bpf4/core.pyx":2986
 *         if x <= self.grid_x0:
 *             out = self.y0
 *         elif x >= self.grid_x1:             # <<<<<<<<<<<<<<
 *             out = self.y1
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":2989
 *             out = self.y1
 *         else:
 *             index0 = int((x - self.grid_x0) / self.grid_dx)             # <<<<<<<<<<<<<<
 *             if self.nointerpol == 1:
 *                 out = self.data[index0]
 */
  /*else*/ {
    __pyx_v_index0 = ((int)((__pyx_v_x - __pyx_v_self->grid_x0) / __pyx_v_self->grid_dx));

    /* "bpf4/core.pyx":2990
 *         else:
 *             index0 = int((x - self.grid_x0) / self.grid_dx)
 *             if self.nointerpol == 1:             # <<<<<<<<<<<<<<
 *                 out = self.data[index0]
 *             else:
 */
    __pyx_t_1 = ((__pyx_v_self->nointerpol == 1) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":2991
 *             index0 = int((x - self.grid_x0) / self.grid_dx)
 *             if self.nointerpol == 1:
 *                 out = self.data[index0]             # <<<<<<<<<<<<<<
 *             else:
 *                 y0 = self.data[index0]
 */
      __pyx_v_out = (__pyx_v_self->data[__pyx_v_index0]);

      /* "bpf4/core.pyx":2990
 *         else:
 *             index0 = int((x - self.grid_x0) / self.grid_dx)
 *             if self.nointerpol == 1:             # <<<<<<<<<<<<<<
 *                 out = self.data[index0]
 *             else:
 */
      goto __pyx_L4;
    }

    /* "bpf4/core.pyx":2993
 *                 out = self.data[index0]
 *             else:
 *                 y0 = self.data[index0]             # <<<<<<<<<<<<<<
 *                 y1 = self.data[index0 + 1]
 *                 x0 = self.grid_x0 + index0 * self.grid_dx
 */
    /*else*/ {
      __pyx_v_y0 = (__pyx_v_self->data[__pyx_v_index0]);

      /* "bpf4/core.pyx":2994
 *             else:
 *                 y0 = self.data[index0]
 *                 y1 = self.data[index0 + 1]             # <<<<<<<<<<<<<<
 *                 x0 = self.grid_x0 + index0 * self.grid_dx
 *                 out = InterpolFunc_call(self.interpolfunc, x, x0, y0, x0+self.grid_dx, y1)
 */
      __pyx_v_y1 = (__pyx_v_self->data[(__pyx_v_index0 + 1)]);

      /* "bpf4/core.pyx":2995
 *                 y0 = self.data[index0]
 *                 y1 = self.data[index0 + 1]
 *                 x0 = self.grid_x0 + index0 * self.grid_dx             # <<<<<<<<<<<<<<
 *                 out = InterpolFunc_call(self.interpolfunc, x, x0, y0, x0+self.grid_dx, y1)
 *         return out
 */
      __pyx_v_x0 = (__pyx_v_self->grid_x0 + (__pyx_v_index0 * __pyx_v_self->grid_dx));

      /* "bpf4/core.pyx":2996
 *                 y1 = self.data[index0 + 1]
 *                 x0 = self.grid_x0 + index0 * self.grid_dx
 *                 out = InterpolFunc_call(self.interpolfunc, x, x0, y0, x0+self.grid_dx, y1)             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
      __pyx_v_out = __pyx_f_4bpf4_4core_InterpolFunc_call(__pyx_v_self->interpolfunc, __pyx_v_x, __pyx_v_x0, __pyx_v_y0, (__pyx_v_x0 + __pyx_v_self->grid_dx), __pyx_v_y1);
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":2997
 *                 x0 = self.grid_x0 + index0 * self.grid_dx
 *                 out = InterpolFunc_call(self.interpolfunc, x, x0, y0, x0+self.grid_dx, y1)
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bpf4/core.pyx":2980
 * 
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef int index0
 *         cdef double y0, y1, x0
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":3000
 * 
 *     @cython.cdivision(True)
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */

static PyObject *__pyx_pw_4bpf4_4core_7Sampled_11mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_7Sampled_mapn_between(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7Sampled_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_data;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_selfdata;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_index0;
  int __pyx_v_nointerpol;
  double __pyx_v_x;
  double __pyx_v_y;
  double __pyx_v_grid_x0;
  double __pyx_v_grid_x1;
  double __pyx_v_self_y0;
  double __pyx_v_self_y1;
  double __pyx_v_grid_dx;
  double __pyx_v_interp_x0;
  double __pyx_v_dx;
  CYTHON_UNUSED double __pyx_v_interpolfunc_exp;
  CYTHON_UNUSED __pyx_t_4bpf4_4core_t_func __pyx_v_interpolfunc;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  double __pyx_t_14;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_t_15;
  __pyx_t_4bpf4_4core_t_func __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_out);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3000, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_7Sampled_11mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3000, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3000, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3000, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3000, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3000, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3000, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3000, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3000, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3022
 *         cdef double x, y
 *         cdef double grid_x0, grid_x1, self_y0, self_y1, grid_dx, interp_x0, interp_y0, interp_y1
 *         cdef double dx = (x1 - x0) / (n - 1) # we account for the edge (x1 IS INCLUDED)             # <<<<<<<<<<<<<<
 *         cdef double interpolfunc_exp
 *         cdef t_func interpolfunc
 */
  __pyx_v_dx = ((__pyx_v_x1 - __pyx_v_x0) / ((double)(__pyx_v_n - 1)));

  /* "bpf4/core.pyx":3025
 *         cdef double interpolfunc_exp
 *         cdef t_func interpolfunc
 *         if out is None:             # <<<<<<<<<<<<<<
 *             out = EMPTY1D(n)
 *             data = <DTYPE_t *>out.data
 */
  __pyx_t_10 = (((PyObject *)__pyx_v_out) == Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":3026
 *         cdef t_func interpolfunc
 *         if out is None:
 *             out = EMPTY1D(n)             # <<<<<<<<<<<<<<
 *             data = <DTYPE_t *>out.data
 *         elif PyArray_ISCONTIGUOUS(out):
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_out, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "bpf4/core.pyx":3027
 *         if out is None:
 *             out = EMPTY1D(n)
 *             data = <DTYPE_t *>out.data             # <<<<<<<<<<<<<<
 *         elif PyArray_ISCONTIGUOUS(out):
 *             data = <DTYPE_t *>out.data
 */
    __pyx_v_data = ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_out->data);

    /* "bpf4/core.pyx":3025
 *         cdef double interpolfunc_exp
 *         cdef t_func interpolfunc
 *         if out is None:             # <<<<<<<<<<<<<<
 *             out = EMPTY1D(n)
 *             data = <DTYPE_t *>out.data
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":3028
 *             out = EMPTY1D(n)
 *             data = <DTYPE_t *>out.data
 *         elif PyArray_ISCONTIGUOUS(out):             # <<<<<<<<<<<<<<
 *             data = <DTYPE_t *>out.data
 *         else:
 */
  __pyx_t_11 = (PyArray_ISCONTIGUOUS(__pyx_v_out) != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":3029
 *             data = <DTYPE_t *>out.data
 *         elif PyArray_ISCONTIGUOUS(out):
 *             data = <DTYPE_t *>out.data             # <<<<<<<<<<<<<<
 *         else:
 *             for i in range(n):
 */
    __pyx_v_data = ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_out->data);

    /* "bpf4/core.pyx":3028
 *             out = EMPTY1D(n)
 *             data = <DTYPE_t *>out.data
 *         elif PyArray_ISCONTIGUOUS(out):             # <<<<<<<<<<<<<<
 *             data = <DTYPE_t *>out.data
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":3031
 *             data = <DTYPE_t *>out.data
 *         else:
 *             for i in range(n):             # <<<<<<<<<<<<<<
 *                 out[i] = self.__ccall__(x0 + dx*i)
 *             return out
 */
  /*else*/ {
    __pyx_t_8 = __pyx_v_n;
    __pyx_t_12 = __pyx_t_8;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_i = __pyx_t_13;

      /* "bpf4/core.pyx":3032
 *         else:
 *             for i in range(n):
 *                 out[i] = self.__ccall__(x0 + dx*i)             # <<<<<<<<<<<<<<
 *             return out
 *         grid_x0 = self.grid_x0
 */
      __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4bpf4_4core_Sampled *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___ccall__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), (__pyx_v_x0 + (__pyx_v_dx * __pyx_v_i)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3032, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_1, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 3032, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }

    /* "bpf4/core.pyx":3033
 *             for i in range(n):
 *                 out[i] = self.__ccall__(x0 + dx*i)
 *             return out             # <<<<<<<<<<<<<<
 *         grid_x0 = self.grid_x0
 *         grid_x1 = self.grid_x1
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = __pyx_v_out;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":3034
 *                 out[i] = self.__ccall__(x0 + dx*i)
 *             return out
 *         grid_x0 = self.grid_x0             # <<<<<<<<<<<<<<
 *         grid_x1 = self.grid_x1
 *         self_y0 = self.y0
 */
  __pyx_t_14 = __pyx_v_self->grid_x0;
  __pyx_v_grid_x0 = __pyx_t_14;

  /* "bpf4/core.pyx":3035
 *             return out
 *         grid_x0 = self.grid_x0
 *         grid_x1 = self.grid_x1             # <<<<<<<<<<<<<<
 *         self_y0 = self.y0
 *         self_y1 = self.y1
 */
  __pyx_t_14 = __pyx_v_self->grid_x1;
  __pyx_v_grid_x1 = __pyx_t_14;

  /* "bpf4/core.pyx":3036
 *         grid_x0 = self.grid_x0
 *         grid_x1 = self.grid_x1
 *         self_y0 = self.y0             # <<<<<<<<<<<<<<
 *         self_y1 = self.y1
 *         grid_dx = self.grid_dx
 */
  __pyx_t_14 = __pyx_v_self->y0;
  __pyx_v_self_y0 = __pyx_t_14;

  /* "bpf4/core.pyx":3037
 *         grid_x1 = self.grid_x1
 *         self_y0 = self.y0
 *         self_y1 = self.y1             # <<<<<<<<<<<<<<
 *         grid_dx = self.grid_dx
 *         selfdata = self.data
 */
  __pyx_t_14 = __pyx_v_self->y1;
  __pyx_v_self_y1 = __pyx_t_14;

  /* "bpf4/core.pyx":3038
 *         self_y0 = self.y0
 *         self_y1 = self.y1
 *         grid_dx = self.grid_dx             # <<<<<<<<<<<<<<
 *         selfdata = self.data
 *         nointerpol = self.nointerpol
 */
  __pyx_t_14 = __pyx_v_self->grid_dx;
  __pyx_v_grid_dx = __pyx_t_14;

  /* "bpf4/core.pyx":3039
 *         self_y1 = self.y1
 *         grid_dx = self.grid_dx
 *         selfdata = self.data             # <<<<<<<<<<<<<<
 *         nointerpol = self.nointerpol
 *         interpolfunc = self.interpolfunc.func
 */
  __pyx_t_15 = __pyx_v_self->data;
  __pyx_v_selfdata = __pyx_t_15;

  /* "bpf4/core.pyx":3040
 *         grid_dx = self.grid_dx
 *         selfdata = self.data
 *         nointerpol = self.nointerpol             # <<<<<<<<<<<<<<
 *         interpolfunc = self.interpolfunc.func
 *         interpolfunc_exp = self.interpolfunc.exp
 */
  __pyx_t_8 = __pyx_v_self->nointerpol;
  __pyx_v_nointerpol = __pyx_t_8;

  /* "bpf4/core.pyx":3041
 *         selfdata = self.data
 *         nointerpol = self.nointerpol
 *         interpolfunc = self.interpolfunc.func             # <<<<<<<<<<<<<<
 *         interpolfunc_exp = self.interpolfunc.exp
 *         i = 0
 */
  __pyx_t_16 = __pyx_v_self->interpolfunc->func;
  __pyx_v_interpolfunc = __pyx_t_16;

  /* "bpf4/core.pyx":3042
 *         nointerpol = self.nointerpol
 *         interpolfunc = self.interpolfunc.func
 *         interpolfunc_exp = self.interpolfunc.exp             # <<<<<<<<<<<<<<
 *         i = 0
 *         with nogil:
 */
  __pyx_t_14 = __pyx_v_self->interpolfunc->exp;
  __pyx_v_interpolfunc_exp = __pyx_t_14;

  /* "bpf4/core.pyx":3043
 *         interpolfunc = self.interpolfunc.func
 *         interpolfunc_exp = self.interpolfunc.exp
 *         i = 0             # <<<<<<<<<<<<<<
 *         with nogil:
 *             while i < n:
 */
  __pyx_v_i = 0;

  /* "bpf4/core.pyx":3044
 *         interpolfunc_exp = self.interpolfunc.exp
 *         i = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             while i < n:
 *                 x = x0 + dx * i
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "bpf4/core.pyx":3045
 *         i = 0
 *         with nogil:
 *             while i < n:             # <<<<<<<<<<<<<<
 *                 x = x0 + dx * i
 *                 if x > grid_x0:
 */
        while (1) {
          __pyx_t_11 = ((__pyx_v_i < __pyx_v_n) != 0);
          if (!__pyx_t_11) break;

          /* "bpf4/core.pyx":3046
 *         with nogil:
 *             while i < n:
 *                 x = x0 + dx * i             # <<<<<<<<<<<<<<
 *                 if x > grid_x0:
 *                     break
 */
          __pyx_v_x = (__pyx_v_x0 + (__pyx_v_dx * __pyx_v_i));

          /* "bpf4/core.pyx":3047
 *             while i < n:
 *                 x = x0 + dx * i
 *                 if x > grid_x0:             # <<<<<<<<<<<<<<
 *                     break
 *                 data[i] = self_y0
 */
          __pyx_t_11 = ((__pyx_v_x > __pyx_v_grid_x0) != 0);
          if (__pyx_t_11) {

            /* "bpf4/core.pyx":3048
 *                 x = x0 + dx * i
 *                 if x > grid_x0:
 *                     break             # <<<<<<<<<<<<<<
 *                 data[i] = self_y0
 *                 i += 1
 */
            goto __pyx_L10_break;

            /* "bpf4/core.pyx":3047
 *             while i < n:
 *                 x = x0 + dx * i
 *                 if x > grid_x0:             # <<<<<<<<<<<<<<
 *                     break
 *                 data[i] = self_y0
 */
          }

          /* "bpf4/core.pyx":3049
 *                 if x > grid_x0:
 *                     break
 *                 data[i] = self_y0             # <<<<<<<<<<<<<<
 *                 i += 1
 *             while i < n:
 */
          (__pyx_v_data[__pyx_v_i]) = __pyx_v_self_y0;

          /* "bpf4/core.pyx":3050
 *                     break
 *                 data[i] = self_y0
 *                 i += 1             # <<<<<<<<<<<<<<
 *             while i < n:
 *                 x = x0 + dx * i
 */
          __pyx_v_i = (__pyx_v_i + 1);
        }
        __pyx_L10_break:;

        /* "bpf4/core.pyx":3051
 *                 data[i] = self_y0
 *                 i += 1
 *             while i < n:             # <<<<<<<<<<<<<<
 *                 x = x0 + dx * i
 *                 if x >= grid_x1:
 */
        while (1) {
          __pyx_t_11 = ((__pyx_v_i < __pyx_v_n) != 0);
          if (!__pyx_t_11) break;

          /* "bpf4/core.pyx":3052
 *                 i += 1
 *             while i < n:
 *                 x = x0 + dx * i             # <<<<<<<<<<<<<<
 *                 if x >= grid_x1:
 *                     break
 */
          __pyx_v_x = (__pyx_v_x0 + (__pyx_v_dx * __pyx_v_i));

          /* "bpf4/core.pyx":3053
 *             while i < n:
 *                 x = x0 + dx * i
 *                 if x >= grid_x1:             # <<<<<<<<<<<<<<
 *                     break
 *                 index0 = int((x - grid_x0) / grid_dx)
 */
          __pyx_t_11 = ((__pyx_v_x >= __pyx_v_grid_x1) != 0);
          if (__pyx_t_11) {

            /* "bpf4/core.pyx":3054
 *                 x = x0 + dx * i
 *                 if x >= grid_x1:
 *                     break             # <<<<<<<<<<<<<<
 *                 index0 = int((x - grid_x0) / grid_dx)
 *                 if nointerpol == 0:
 */
            goto __pyx_L13_break;

            /* "bpf4/core.pyx":3053
 *             while i < n:
 *                 x = x0 + dx * i
 *                 if x >= grid_x1:             # <<<<<<<<<<<<<<
 *                     break
 *                 index0 = int((x - grid_x0) / grid_dx)
 */
          }

          /* "bpf4/core.pyx":3055
 *                 if x >= grid_x1:
 *                     break
 *                 index0 = int((x - grid_x0) / grid_dx)             # <<<<<<<<<<<<<<
 *                 if nointerpol == 0:
 *                     y = selfdata[index0]
 */
          __pyx_v_index0 = ((int)((__pyx_v_x - __pyx_v_grid_x0) / __pyx_v_grid_dx));

          /* "bpf4/core.pyx":3056
 *                     break
 *                 index0 = int((x - grid_x0) / grid_dx)
 *                 if nointerpol == 0:             # <<<<<<<<<<<<<<
 *                     y = selfdata[index0]
 *                 else:
 */
          __pyx_t_11 = ((__pyx_v_nointerpol == 0) != 0);
          if (__pyx_t_11) {

            /* "bpf4/core.pyx":3057
 *                 index0 = int((x - grid_x0) / grid_dx)
 *                 if nointerpol == 0:
 *                     y = selfdata[index0]             # <<<<<<<<<<<<<<
 *                 else:
 *                     interp_x0 = grid_x0 + index0 * grid_dx
 */
            __pyx_v_y = (__pyx_v_selfdata[__pyx_v_index0]);

            /* "bpf4/core.pyx":3056
 *                     break
 *                 index0 = int((x - grid_x0) / grid_dx)
 *                 if nointerpol == 0:             # <<<<<<<<<<<<<<
 *                     y = selfdata[index0]
 *                 else:
 */
            goto __pyx_L15;
          }

          /* "bpf4/core.pyx":3059
 *                     y = selfdata[index0]
 *                 else:
 *                     interp_x0 = grid_x0 + index0 * grid_dx             # <<<<<<<<<<<<<<
 *                     y = InterpolFunc_call(self.interpolfunc, x, interp_x0, selfdata[index0],
 *                                           interp_x0 + grid_dx, selfdata[index0+1])
 */
          /*else*/ {
            __pyx_v_interp_x0 = (__pyx_v_grid_x0 + (__pyx_v_index0 * __pyx_v_grid_dx));

            /* "bpf4/core.pyx":3060
 *                 else:
 *                     interp_x0 = grid_x0 + index0 * grid_dx
 *                     y = InterpolFunc_call(self.interpolfunc, x, interp_x0, selfdata[index0],             # <<<<<<<<<<<<<<
 *                                           interp_x0 + grid_dx, selfdata[index0+1])
 *                 data[i] = y
 */
            __pyx_v_y = __pyx_f_4bpf4_4core_InterpolFunc_call(__pyx_v_self->interpolfunc, __pyx_v_x, __pyx_v_interp_x0, (__pyx_v_selfdata[__pyx_v_index0]), (__pyx_v_interp_x0 + __pyx_v_grid_dx), (__pyx_v_selfdata[(__pyx_v_index0 + 1)]));
          }
          __pyx_L15:;

          /* "bpf4/core.pyx":3062
 *                     y = InterpolFunc_call(self.interpolfunc, x, interp_x0, selfdata[index0],
 *                                           interp_x0 + grid_dx, selfdata[index0+1])
 *                 data[i] = y             # <<<<<<<<<<<<<<
 *                 i += 1
 *             for j in range(i, n):
 */
          (__pyx_v_data[__pyx_v_i]) = __pyx_v_y;

          /* "bpf4/core.pyx":3063
 *                                           interp_x0 + grid_dx, selfdata[index0+1])
 *                 data[i] = y
 *                 i += 1             # <<<<<<<<<<<<<<
 *             for j in range(i, n):
 *                 data[j] = self_y1
 */
          __pyx_v_i = (__pyx_v_i + 1);
        }
        __pyx_L13_break:;

        /* "bpf4/core.pyx":3064
 *                 data[i] = y
 *                 i += 1
 *             for j in range(i, n):             # <<<<<<<<<<<<<<
 *                 data[j] = self_y1
 *         return out
 */
        __pyx_t_8 = __pyx_v_n;
        __pyx_t_12 = __pyx_t_8;
        for (__pyx_t_13 = __pyx_v_i; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
          __pyx_v_j = __pyx_t_13;

          /* "bpf4/core.pyx":3065
 *                 i += 1
 *             for j in range(i, n):
 *                 data[j] = self_y1             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
          (__pyx_v_data[__pyx_v_j]) = __pyx_v_self_y1;
        }
      }

      /* "bpf4/core.pyx":3044
 *         interpolfunc_exp = self.interpolfunc.exp
 *         i = 0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             while i < n:
 *                 x = x0 + dx * i
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L8:;
      }
  }

  /* "bpf4/core.pyx":3066
 *             for j in range(i, n):
 *                 data[j] = self_y1
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3000
 * 
 *     @cython.cdivision(True)
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bpf4.core.Sampled.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_11mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled_10mapn_between[] = "Sampled.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray\n\n        Return an array of `n` elements resulting of evaluating this bpf regularly\n\n        The x coordinates at which this bpf is evaluated are equivalent to `linspace(xstart, xend, n)`\n\n        Args:\n            n (int): the number of elements to generate\n            x0 (float): x to start mapping\n            x1 (float): x to end mapping\n            out (ndarray): if given, result is put here\n\n        Returns:\n            (ndarray) An array of this bpf evaluated at a grid [xstart:xend:dx], where *dx*\n            is `(xend-xstart)/n`\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Sampled_11mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7Sampled_11mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7Sampled_10mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_11mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 3000, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 3000, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 3000, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3000, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3000, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3000, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3000, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Sampled.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 3000, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_10mapn_between(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_10mapn_between(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_Sampled->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Sampled.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3069
 * 
 *     @classmethod
 *     def fromseq(cls, *args, **kws): raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def _get_points_for_rendering(self, int n= -1):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_13fromseq(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled_12fromseq[] = "Sampled.fromseq(type cls, *args, **kws)";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Sampled_13fromseq = {"fromseq", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7Sampled_13fromseq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7Sampled_12fromseq};
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_13fromseq(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kws = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fromseq (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fromseq", 1))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_12fromseq(((PyTypeObject*)__pyx_v_cls), __pyx_v_args, __pyx_v_kws);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kws);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_12fromseq(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kws) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fromseq", 0);
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(0, 3069, __pyx_L1_error)

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core.Sampled.fromseq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3071
 *     def fromseq(cls, *args, **kws): raise NotImplementedError
 * 
 *     def _get_points_for_rendering(self, int n= -1):             # <<<<<<<<<<<<<<
 *         return self.xs, self.ys
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_15_get_points_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled_14_get_points_for_rendering[] = "Sampled._get_points_for_rendering(self, int n=-1)";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Sampled_15_get_points_for_rendering = {"_get_points_for_rendering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7Sampled_15_get_points_for_rendering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7Sampled_14_get_points_for_rendering};
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_15_get_points_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED int __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_points_for_rendering (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_points_for_rendering") < 0)) __PYX_ERR(0, 3071, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3071, __pyx_L3_error)
    } else {
      __pyx_v_n = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_points_for_rendering", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3071, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Sampled._get_points_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_14_get_points_for_rendering(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self), __pyx_v_n);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_14_get_points_for_rendering(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, CYTHON_UNUSED int __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_points_for_rendering", 0);

  /* "bpf4/core.pyx":3072
 * 
 *     def _get_points_for_rendering(self, int n= -1):
 *         return self.xs, self.ys             # <<<<<<<<<<<<<<
 * 
 *     def segments(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_xs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->ys));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->ys));
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3071
 *     def fromseq(cls, *args, **kws): raise NotImplementedError
 * 
 *     def _get_points_for_rendering(self, int n= -1):             # <<<<<<<<<<<<<<
 *         return self.xs, self.ys
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core.Sampled._get_points_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4bpf4_4core_7Sampled_18generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "bpf4/core.pyx":3074
 *         return self.xs, self.ys
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_17segments(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled_16segments[] = "Sampled.segments(self)\n\n        Returns an iterator over the segments of this bpf\n\n        Returns:\n            (Iterable[tuple[float, float, str, float]]) An iterator of segments, \n            where each segment has the form `(x, y, interpoltype:str, exponent)`\n\n\n        Each item is a tuple `(float x, float y, str interpolation_type, float exponent)`\n\n        **NB**: exponent is only relevant if the interpolation type makes use of it\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Sampled_17segments = {"segments", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_17segments, METH_NOARGS, __pyx_doc_4bpf4_4core_7Sampled_16segments};
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_17segments(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segments (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_16segments(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_16segments(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segments", 0);
  __pyx_cur_scope = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments *)__pyx_tp_new_4bpf4_4core___pyx_scope_struct_1_segments(__pyx_ptype_4bpf4_4core___pyx_scope_struct_1_segments, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3074, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4bpf4_4core_7Sampled_18generator1, __pyx_codeobj__28, (PyObject *) __pyx_cur_scope, __pyx_n_s_segments, __pyx_n_s_Sampled_segments, __pyx_n_s_bpf4_core); if (unlikely(!gen)) __PYX_ERR(0, 3074, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core.Sampled.segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4bpf4_4core_7Sampled_18generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments *__pyx_cur_scope = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  double __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segments", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3074, __pyx_L1_error)

  /* "bpf4/core.pyx":3088
 *         """
 *         cdef int i
 *         cdef double x0 = self.grid_x0             # <<<<<<<<<<<<<<
 *         cdef double dx = self.grid_dx
 *         descr = self.interpolation
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_self->grid_x0;
  __pyx_cur_scope->__pyx_v_x0 = __pyx_t_1;

  /* "bpf4/core.pyx":3089
 *         cdef int i
 *         cdef double x0 = self.grid_x0
 *         cdef double dx = self.grid_dx             # <<<<<<<<<<<<<<
 *         descr = self.interpolation
 *         exp = self.interpolfunc.exp if self.interpolfunc is not NULL else 0.0
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_self->grid_dx;
  __pyx_cur_scope->__pyx_v_dx = __pyx_t_1;

  /* "bpf4/core.pyx":3090
 *         cdef double x0 = self.grid_x0
 *         cdef double dx = self.grid_dx
 *         descr = self.interpolation             # <<<<<<<<<<<<<<
 *         exp = self.interpolfunc.exp if self.interpolfunc is not NULL else 0.0
 *         for i in range(self.samples_size):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_descr = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":3091
 *         cdef double dx = self.grid_dx
 *         descr = self.interpolation
 *         exp = self.interpolfunc.exp if self.interpolfunc is not NULL else 0.0             # <<<<<<<<<<<<<<
 *         for i in range(self.samples_size):
 *             yield (x0 + i*dx, self.data[i], descr, exp)
 */
  if (((__pyx_cur_scope->__pyx_v_self->interpolfunc != NULL) != 0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_self->interpolfunc->exp;
  } else {
    __pyx_t_1 = 0.0;
  }
  __pyx_cur_scope->__pyx_v_exp = __pyx_t_1;

  /* "bpf4/core.pyx":3092
 *         descr = self.interpolation
 *         exp = self.interpolfunc.exp if self.interpolfunc is not NULL else 0.0
 *         for i in range(self.samples_size):             # <<<<<<<<<<<<<<
 *             yield (x0 + i*dx, self.data[i], descr, exp)
 * 
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_self->samples_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_5;

    /* "bpf4/core.pyx":3093
 *         exp = self.interpolfunc.exp if self.interpolfunc is not NULL else 0.0
 *         for i in range(self.samples_size):
 *             yield (x0 + i*dx, self.data[i], descr, exp)             # <<<<<<<<<<<<<<
 * 
 *     cpdef double integrate(self):
 */
    __pyx_t_2 = PyFloat_FromDouble((__pyx_cur_scope->__pyx_v_x0 + (__pyx_cur_scope->__pyx_v_i * __pyx_cur_scope->__pyx_v_dx))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyFloat_FromDouble((__pyx_cur_scope->__pyx_v_self->data[__pyx_cur_scope->__pyx_v_i])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_exp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_descr);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_descr);
    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_cur_scope->__pyx_v_descr);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
    __pyx_t_2 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3093, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "bpf4/core.pyx":3074
 *         return self.xs, self.ys
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3095
 *             yield (x0 + i*dx, self.data[i], descr, exp)
 * 
 *     cpdef double integrate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the result of the integration of this bpf.
 */

static PyObject *__pyx_pw_4bpf4_4core_7Sampled_20integrate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static double __pyx_f_4bpf4_4core_7Sampled_integrate(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, int __pyx_skip_dispatch) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_7Sampled_20integrate)) {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3095, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3111
 *         ```
 *         """
 *         return _integr_trapz(self.data, self.samples_size, self.grid_dx)             # <<<<<<<<<<<<<<
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 */
  __pyx_r = __pyx_f_4bpf4_4core__integr_trapz(__pyx_v_self->data, __pyx_v_self->samples_size, __pyx_v_self->grid_dx);
  goto __pyx_L0;

  /* "bpf4/core.pyx":3095
 *             yield (x0 + i*dx, self.data[i], descr, exp)
 * 
 *     cpdef double integrate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the result of the integration of this bpf.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("bpf4.core.Sampled.integrate", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_20integrate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled_19integrate[] = "Sampled.integrate(self) -> double\n\n        Return the result of the integration of this bpf. \n\n        If any of the bounds is `inf`, the result is also `inf`.\n\n        **NB**: to determine the limits of the integration, first crop the bpf via a slice\n        \n        ## Example\n        \n        Integrate this bpf from its lower bound to 10 (inclusive)\n        \n        ```python\n        b[:10].integrate()  \n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Sampled_20integrate = {"integrate", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_20integrate, METH_NOARGS, __pyx_doc_4bpf4_4core_7Sampled_19integrate};
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_20integrate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_19integrate(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_19integrate(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_f_4bpf4_4core_7Sampled_integrate(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Sampled.integrate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3113
 *         return _integr_trapz(self.data, self.samples_size, self.grid_dx)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         The same as integrate() but between the (included) bounds x0-x1
 */

static PyObject *__pyx_pw_4bpf4_4core_7Sampled_22integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_4bpf4_4core_7Sampled_integrate_between(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7Sampled_integrate_between *__pyx_optional_args) {
  size_t __pyx_v_N = ((size_t)0);
  double __pyx_v_dx;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_7Sampled_22integrate_between)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3113, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3113, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3113, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3113, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3113, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3113, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3113, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3113, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3121
 *         **NB**: N has no effect. It is put here to comply with the signature of the function.
 *         """
 *         dx = self.grid_dx             # <<<<<<<<<<<<<<
 *         return _integr_trapz_between_exact(self.data, self.samples_size, dx, self.grid_x0, x0, x1)
 * 
 */
  __pyx_t_10 = __pyx_v_self->grid_dx;
  __pyx_v_dx = __pyx_t_10;

  /* "bpf4/core.pyx":3122
 *         """
 *         dx = self.grid_dx
 *         return _integr_trapz_between_exact(self.data, self.samples_size, dx, self.grid_x0, x0, x1)             # <<<<<<<<<<<<<<
 * 
 *     cpdef BpfInterface derivative(self):
 */
  __pyx_r = __pyx_f_4bpf4_4core__integr_trapz_between_exact(__pyx_v_self->data, __pyx_v_self->samples_size, __pyx_v_dx, __pyx_v_self->grid_x0, __pyx_v_x0, __pyx_v_x1);
  goto __pyx_L0;

  /* "bpf4/core.pyx":3113
 *         return _integr_trapz(self.data, self.samples_size, self.grid_dx)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         The same as integrate() but between the (included) bounds x0-x1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("bpf4.core.Sampled.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_22integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled_21integrate_between[] = "Sampled.integrate_between(self, double x0, double x1, size_t N=0) -> double\n\n        The same as integrate() but between the (included) bounds x0-x1\n\n        It is effectively the same as `bpf[x0:x1].integrate()`, but more efficient\n        \n        **NB**: N has no effect. It is put here to comply with the signature of the function. \n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Sampled_22integrate_between = {"integrate_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7Sampled_22integrate_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7Sampled_21integrate_between};
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_22integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  size_t __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, 1); __PYX_ERR(0, 3113, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_between") < 0)) __PYX_ERR(0, 3113, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3113, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3113, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_N == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3113, __pyx_L3_error)
    } else {
      __pyx_v_N = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3113, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Sampled.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_21integrate_between(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_21integrate_between(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core_Sampled->__pyx_base.integrate_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2); 
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.Sampled.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3124
 *         return _integr_trapz_between_exact(self.data, self.samples_size, dx, self.grid_x0, x0, x1)
 * 
 *     cpdef BpfInterface derivative(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a curve which represents the derivative of this curve
 */

static PyObject *__pyx_pw_4bpf4_4core_7Sampled_24derivative(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_7Sampled_derivative(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("derivative", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_derivative); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_7Sampled_24derivative)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3124, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 3124, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3149
 *         ![](assets/derivative1.png)
 *         """
 *         return _BpfDeriv(self, self.grid_dx*0.99)             # <<<<<<<<<<<<<<
 * 
 *     def inverted(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->grid_dx * 0.99)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfDeriv), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3124
 *         return _integr_trapz_between_exact(self.data, self.samples_size, dx, self.grid_x0, x0, x1)
 * 
 *     cpdef BpfInterface derivative(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a curve which represents the derivative of this curve
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.Sampled.derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_24derivative(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled_23derivative[] = "Sampled.derivative(self) -> BpfInterface\n\n        Return a curve which represents the derivative of this curve\n\n        It implements Newtons difference quotiont, so that:\n\n\n            derivative(x) = bpf(x + h) - bpf(x)\n                            -------------------\n                                      h\n        \n        Example\n        -------\n\n        ```python\n        \n        >>> from bpf4 import *\n        >>> a = slope(1)[0:6.28].sin()\n        >>> a.plot(show=False, color=\"red\")\n        >>> b = a.derivative()\n        >>> b.plot(color=\"blue\")\n\n        ```\n        ![](assets/derivative1.png)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Sampled_24derivative = {"derivative", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_24derivative, METH_NOARGS, __pyx_doc_4bpf4_4core_7Sampled_23derivative};
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_24derivative(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("derivative (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_23derivative(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_23derivative(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("derivative", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_7Sampled_derivative(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Sampled.derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3151
 *         return _BpfDeriv(self, self.grid_dx*0.99)
 * 
 *     def inverted(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view on this bpf with the coords inverted
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_26inverted(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled_25inverted[] = "Sampled.inverted(self)\n\n        Return a view on this bpf with the coords inverted\n\n        Returns:\n            (BpfInterface) a view on this bpf with the coords inverted\n\n        In an inverted function the coordinates are swaped: the inverted version of a \n        bpf indicates which *x* corresponds to a given *y*\n        \n        Returns None if the function is not invertible. For a function to be invertible, \n        it must be strictly increasing or decreasing, with no local maxima or minima.\n        \n\n            f.inverted()(f(x)) = x\n        \n        \n        So if `y(1) == 2`, then `y.inverted()(2) == 1`\n\n        ![](assets/inverted.png)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Sampled_26inverted = {"inverted", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_26inverted, METH_NOARGS, __pyx_doc_4bpf4_4core_7Sampled_25inverted};
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_26inverted(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inverted (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_25inverted(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_25inverted(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("inverted", 0);

  /* "bpf4/core.pyx":3173
 *         """
 * 
 *         return Linear(self.xs, self.ys).inverted()             # <<<<<<<<<<<<<<
 * 
 *     def flatpairs(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_xs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->ys));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->ys));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self->ys));
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Linear), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inverted); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3151
 *         return _BpfDeriv(self, self.grid_dx*0.99)
 * 
 *     def inverted(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view on this bpf with the coords inverted
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.Sampled.inverted", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3175
 *         return Linear(self.xs, self.ys).inverted()
 * 
 *     def flatpairs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a flat 1D array with x and y values interlaced
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_28flatpairs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7Sampled_27flatpairs[] = "Sampled.flatpairs(self)\n\n        Returns a flat 1D array with x and y values interlaced\n\n        Returns:\n            (ndarray) A 1D array with x and y values interlaced\n\n        ```python\n        >>> a = linear(0, 0, 1, 10, 2, 20)\n        >>> a.flatpairs()\n        array([0, 0, 1, 10, 2, 20])\n        ```\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7Sampled_28flatpairs = {"flatpairs", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_28flatpairs, METH_NOARGS, __pyx_doc_4bpf4_4core_7Sampled_27flatpairs};
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_28flatpairs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flatpairs (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_27flatpairs(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_27flatpairs(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flatpairs", 0);

  /* "bpf4/core.pyx":3188
 *         ```
 *         """
 *         return arraytools.interlace_arrays(self.xs, self.ys)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_arraytools); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_interlace_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_xs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, ((PyObject *)__pyx_v_self->ys)};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3188, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, ((PyObject *)__pyx_v_self->ys)};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3188, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_self->ys));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->ys));
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_self->ys));
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3175
 *         return Linear(self.xs, self.ys).inverted()
 * 
 *     def flatpairs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a flat 1D array with x and y values interlaced
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core.Sampled.flatpairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":2847
 * 
 *     """
 *     cdef readonly ndarray ys             # <<<<<<<<<<<<<<
 *     cdef double y0, y1
 *     cdef double grid_dx, grid_x0, grid_x1
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_2ys_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_7Sampled_2ys_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7Sampled_2ys___get__(((struct __pyx_obj_4bpf4_4core_Sampled *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7Sampled_2ys___get__(struct __pyx_obj_4bpf4_4core_Sampled *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->ys));
  __pyx_r = ((PyObject *)__pyx_v_self->ys);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3214
 *     cdef SplineS* _spline
 * 
 *     def __init__(self, xs, ys):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf with cubic spline interpolation
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_6Spline_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_6Spline___init__[] = "\n        A bpf with cubic spline interpolation\n\n        Args:\n            xs (ndarray): the x coord data\n            ys (ndarray): the y coord data\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_6Spline___init__;
#endif
static int __pyx_pw_4bpf4_4core_6Spline_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3214, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3214, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3214, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Spline.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_6Spline___init__(((struct __pyx_obj_4bpf4_4core_Spline *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_6Spline___init__(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys) {
  PyArrayObject *__pyx_v__xs = 0;
  PyArrayObject *__pyx_v__ys = 0;
  int __pyx_v_N;
  __Pyx_LocalBuf_ND __pyx_pybuffernd__xs;
  __Pyx_Buffer __pyx_pybuffer__xs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd__ys;
  __Pyx_Buffer __pyx_pybuffer__ys;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_pybuffer__xs.pybuffer.buf = NULL;
  __pyx_pybuffer__xs.refcount = 0;
  __pyx_pybuffernd__xs.data = NULL;
  __pyx_pybuffernd__xs.rcbuffer = &__pyx_pybuffer__xs;
  __pyx_pybuffer__ys.pybuffer.buf = NULL;
  __pyx_pybuffer__ys.refcount = 0;
  __pyx_pybuffernd__ys.data = NULL;
  __pyx_pybuffernd__ys.rcbuffer = &__pyx_pybuffer__ys;

  /* "bpf4/core.pyx":3223
 *         """
 * 
 *         cdef ndarray [DTYPE_t, ndim=1] _xs = numpy.asarray(xs, dtype=DTYPE)             # <<<<<<<<<<<<<<
 *         cdef ndarray [DTYPE_t, ndim=1] _ys = numpy.asarray(ys, dtype=DTYPE)
 *         cdef int N = len(xs)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_xs);
  __Pyx_GIVEREF(__pyx_v_xs);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xs);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 3223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __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;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3223, __pyx_L1_error)
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd__xs.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v__xs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd__xs.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 3223, __pyx_L1_error)
    } else {__pyx_pybuffernd__xs.diminfo[0].strides = __pyx_pybuffernd__xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd__xs.diminfo[0].shape = __pyx_pybuffernd__xs.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_5 = 0;
  __pyx_v__xs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "bpf4/core.pyx":3224
 * 
 *         cdef ndarray [DTYPE_t, ndim=1] _xs = numpy.asarray(xs, dtype=DTYPE)
 *         cdef ndarray [DTYPE_t, ndim=1] _ys = numpy.asarray(ys, dtype=DTYPE)             # <<<<<<<<<<<<<<
 *         cdef int N = len(xs)
 *         self._set_bounds(_xs[0], _xs[N - 1])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_ys);
  __Pyx_GIVEREF(__pyx_v_ys);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ys);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 3224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3224, __pyx_L1_error)
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd__ys.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v__ys = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd__ys.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 3224, __pyx_L1_error)
    } else {__pyx_pybuffernd__ys.diminfo[0].strides = __pyx_pybuffernd__ys.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd__ys.diminfo[0].shape = __pyx_pybuffernd__ys.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v__ys = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":3225
 *         cdef ndarray [DTYPE_t, ndim=1] _xs = numpy.asarray(xs, dtype=DTYPE)
 *         cdef ndarray [DTYPE_t, ndim=1] _ys = numpy.asarray(ys, dtype=DTYPE)
 *         cdef int N = len(xs)             # <<<<<<<<<<<<<<
 *         self._set_bounds(_xs[0], _xs[N - 1])
 *         self._integration_mode = 1  # use quad
 */
  __pyx_t_7 = PyObject_Length(__pyx_v_xs); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3225, __pyx_L1_error)
  __pyx_v_N = __pyx_t_7;

  /* "bpf4/core.pyx":3226
 *         cdef ndarray [DTYPE_t, ndim=1] _ys = numpy.asarray(ys, dtype=DTYPE)
 *         cdef int N = len(xs)
 *         self._set_bounds(_xs[0], _xs[N - 1])             # <<<<<<<<<<<<<<
 *         self._integration_mode = 1  # use quad
 *         if _array_issorted(_xs) < 1:
 */
  __pyx_t_8 = 0;
  __pyx_t_9 = (__pyx_v_N - 1);
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), (*__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd__xs.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd__xs.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd__xs.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd__xs.diminfo[0].strides)));

  /* "bpf4/core.pyx":3227
 *         cdef int N = len(xs)
 *         self._set_bounds(_xs[0], _xs[N - 1])
 *         self._integration_mode = 1  # use quad             # <<<<<<<<<<<<<<
 *         if _array_issorted(_xs) < 1:
 *             raise ValueError(f"Points along the x coord should be sorted without duplicates. \n{xs}")
 */
  __pyx_v_self->__pyx_base._integration_mode = 1;

  /* "bpf4/core.pyx":3228
 *         self._set_bounds(_xs[0], _xs[N - 1])
 *         self._integration_mode = 1  # use quad
 *         if _array_issorted(_xs) < 1:             # <<<<<<<<<<<<<<
 *             raise ValueError(f"Points along the x coord should be sorted without duplicates. \n{xs}")
 *         self._spline = SplineS_new(_xs, _ys, N)
 */
  __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(((PyObject *)__pyx_v__xs), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 3228, __pyx_L1_error)
  __pyx_t_11 = ((__pyx_f_4bpf4_4core__array_issorted(__pyx_t_10, 0) < 1) != 0);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;
  if (unlikely(__pyx_t_11)) {

    /* "bpf4/core.pyx":3229
 *         self._integration_mode = 1  # use quad
 *         if _array_issorted(_xs) < 1:
 *             raise ValueError(f"Points along the x coord should be sorted without duplicates. \n{xs}")             # <<<<<<<<<<<<<<
 *         self._spline = SplineS_new(_xs, _ys, N)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_xs, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Points_along_the_x_coord_should_2, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3229, __pyx_L1_error)

    /* "bpf4/core.pyx":3228
 *         self._set_bounds(_xs[0], _xs[N - 1])
 *         self._integration_mode = 1  # use quad
 *         if _array_issorted(_xs) < 1:             # <<<<<<<<<<<<<<
 *             raise ValueError(f"Points along the x coord should be sorted without duplicates. \n{xs}")
 *         self._spline = SplineS_new(_xs, _ys, N)
 */
  }

  /* "bpf4/core.pyx":3230
 *         if _array_issorted(_xs) < 1:
 *             raise ValueError(f"Points along the x coord should be sorted without duplicates. \n{xs}")
 *         self._spline = SplineS_new(_xs, _ys, N)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_spline = __pyx_f_4bpf4_4core_SplineS_new(((PyObject *)__pyx_v__xs), ((PyObject *)__pyx_v__ys), __pyx_v_N, NULL);

  /* "bpf4/core.pyx":3214
 *     cdef SplineS* _spline
 * 
 *     def __init__(self, xs, ys):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf with cubic spline interpolation
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__xs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__ys.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core.Spline.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__xs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__ys.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v__xs);
  __Pyx_XDECREF((PyObject *)__pyx_v__ys);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3232
 *         self._spline = SplineS_new(_xs, _ys, N)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         SplineS_destroy(self._spline)
 * 
 */

/* Python wrapper */
static void __pyx_pw_4bpf4_4core_6Spline_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_4bpf4_4core_6Spline_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_4bpf4_4core_6Spline_2__dealloc__(((struct __pyx_obj_4bpf4_4core_Spline *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_4bpf4_4core_6Spline_2__dealloc__(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "bpf4/core.pyx":3233
 * 
 *     def __dealloc__(self):
 *         SplineS_destroy(self._spline)             # <<<<<<<<<<<<<<
 * 
 *     @cython.boundscheck(False)
 */
  __pyx_f_4bpf4_4core_SplineS_destroy(__pyx_v_self->_spline);

  /* "bpf4/core.pyx":3232
 *         self._spline = SplineS_new(_xs, _ys, N)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         SplineS_destroy(self._spline)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":3236
 * 
 *     @cython.boundscheck(False)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         return SplineS_at(self._spline, x)
 * 
 */

static double __pyx_f_4bpf4_4core_6Spline___ccall__(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self, double __pyx_v_x) {
  double __pyx_r;

  /* "bpf4/core.pyx":3237
 *     @cython.boundscheck(False)
 *     cdef double __ccall__(self, double x) nogil:
 *         return SplineS_at(self._spline, x)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline tuple _points(self):
 */
  __pyx_r = __pyx_f_4bpf4_4core_SplineS_at(__pyx_v_self->_spline, __pyx_v_x);
  goto __pyx_L0;

  /* "bpf4/core.pyx":3236
 * 
 *     @cython.boundscheck(False)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         return SplineS_at(self._spline, x)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":3239
 *         return SplineS_at(self._spline, x)
 * 
 *     cdef inline tuple _points(self):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         xs = [self._spline.xs[i] for i in range(self._spline.length)]
 */

static CYTHON_INLINE PyObject *__pyx_f_4bpf4_4core_6Spline__points(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self) {
  PyObject *__pyx_v_xs = NULL;
  PyObject *__pyx_v_ys = NULL;
  int __pyx_7genexpr__pyx_v_i;
  int __pyx_8genexpr1__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_points", 0);

  /* "bpf4/core.pyx":3241
 *     cdef inline tuple _points(self):
 *         cdef int i
 *         xs = [self._spline.xs[i] for i in range(self._spline.length)]             # <<<<<<<<<<<<<<
 *         ys = [self._spline.ys[i] for i in range(self._spline.length)]
 *         return (xs, ys)
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_self->_spline->length;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_7genexpr__pyx_v_i = __pyx_t_4;
      __pyx_t_5 = PyFloat_FromDouble((__pyx_v_self->_spline->xs[__pyx_7genexpr__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3241, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 3241, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_v_xs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3242
 *         cdef int i
 *         xs = [self._spline.xs[i] for i in range(self._spline.length)]
 *         ys = [self._spline.ys[i] for i in range(self._spline.length)]             # <<<<<<<<<<<<<<
 *         return (xs, ys)
 * 
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_self->_spline->length;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_8genexpr1__pyx_v_i = __pyx_t_4;
      __pyx_t_5 = PyFloat_FromDouble((__pyx_v_self->_spline->ys[__pyx_8genexpr1__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 3242, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_v_ys = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3243
 *         xs = [self._spline.xs[i] for i in range(self._spline.length)]
 *         ys = [self._spline.ys[i] for i in range(self._spline.length)]
 *         return (xs, ys)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_xs);
  __Pyx_GIVEREF(__pyx_v_xs);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xs);
  __Pyx_INCREF(__pyx_v_ys);
  __Pyx_GIVEREF(__pyx_v_ys);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ys);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3239
 *         return SplineS_at(self._spline, x)
 * 
 *     cdef inline tuple _points(self):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         xs = [self._spline.xs[i] for i in range(self._spline.length)]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.Spline._points", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xs);
  __Pyx_XDECREF(__pyx_v_ys);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3245
 *         return (xs, ys)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self._points()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_6Spline_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_6Spline_4__getstate__[] = "Spline.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_6Spline_5__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_6Spline_5__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_6Spline_4__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_6Spline_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_6Spline_4__getstate__(((struct __pyx_obj_4bpf4_4core_Spline *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_6Spline_4__getstate__(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":3246
 * 
 *     def __getstate__(self):
 *         return self._points()             # <<<<<<<<<<<<<<
 * 
 *     def points(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4bpf4_4core_6Spline__points(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3245
 *         return (xs, ys)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self._points()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Spline.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3248
 *         return self._points()
 * 
 *     def points(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple with the points defining this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_6Spline_7points(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_6Spline_6points[] = "Spline.points(self)\n\n        Returns a tuple with the points defining this bpf\n\n        Returns:\n            (tuple[ndarray, ndarray]) a tuple (xs, ys) where `xs` is an array\n            holding the values for the *x* coordinate, and `ys` holds the values for\n            the *y* coordinate\n\n        ## Example\n        \n        ```python\n\n        >>> b = Linear.fromseq(0, 0, 1, 100, 2, 50)\n        >>> b.points()\n        ([0, 1, 2], [0, 100, 50])\n        ```\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_6Spline_7points = {"points", (PyCFunction)__pyx_pw_4bpf4_4core_6Spline_7points, METH_NOARGS, __pyx_doc_4bpf4_4core_6Spline_6points};
static PyObject *__pyx_pw_4bpf4_4core_6Spline_7points(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("points (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_6Spline_6points(((struct __pyx_obj_4bpf4_4core_Spline *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_6Spline_6points(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("points", 0);

  /* "bpf4/core.pyx":3267
 * 
 *         """
 *         return self._points()             # <<<<<<<<<<<<<<
 * 
 *     def segments(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4bpf4_4core_6Spline__points(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3248
 *         return self._points()
 * 
 *     def points(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple with the points defining this bpf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Spline.points", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4bpf4_4core_6Spline_10generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "bpf4/core.pyx":3269
 *         return self._points()
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_6Spline_9segments(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_6Spline_8segments[] = "Spline.segments(self)\n\n        Returns an iterator over the segments of this bpf\n\n        Returns:\n            (Iterable[tuple[float, float, str, float]]) An iterator of segments, \n            where each segment has the form `(x, y, interpoltype:str, exponent)`\n\n\n        Each segment is a tuple `(float x, float y, str interpolation_type, float exponent)`\n\n        !!! note\n        \n            Exponent is only relevant if the interpolation type makes use of it\n        \n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_6Spline_9segments = {"segments", (PyCFunction)__pyx_pw_4bpf4_4core_6Spline_9segments, METH_NOARGS, __pyx_doc_4bpf4_4core_6Spline_8segments};
static PyObject *__pyx_pw_4bpf4_4core_6Spline_9segments(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segments (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_6Spline_8segments(((struct __pyx_obj_4bpf4_4core_Spline *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_6Spline_8segments(struct __pyx_obj_4bpf4_4core_Spline *__pyx_v_self) {
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segments", 0);
  __pyx_cur_scope = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments *)__pyx_tp_new_4bpf4_4core___pyx_scope_struct_2_segments(__pyx_ptype_4bpf4_4core___pyx_scope_struct_2_segments, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3269, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4bpf4_4core_6Spline_10generator2, __pyx_codeobj__29, (PyObject *) __pyx_cur_scope, __pyx_n_s_segments, __pyx_n_s_Spline_segments, __pyx_n_s_bpf4_core); if (unlikely(!gen)) __PYX_ERR(0, 3269, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core.Spline.segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4bpf4_4core_6Spline_10generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments *__pyx_cur_scope = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segments", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    case 2: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3269, __pyx_L1_error)

  /* "bpf4/core.pyx":3287
 *         cdef size_t i
 *         cdef size_t num_segments
 *         exp = 0             # <<<<<<<<<<<<<<
 *         num_segments = self._spline.length - 1
 *         interpoltype = self.__class__.__name__.lower()
 */
  __pyx_cur_scope->__pyx_v_exp = 0;

  /* "bpf4/core.pyx":3288
 *         cdef size_t num_segments
 *         exp = 0
 *         num_segments = self._spline.length - 1             # <<<<<<<<<<<<<<
 *         interpoltype = self.__class__.__name__.lower()
 *         for i in range(num_segments):
 */
  __pyx_cur_scope->__pyx_v_num_segments = (__pyx_cur_scope->__pyx_v_self->_spline->length - 1);

  /* "bpf4/core.pyx":3289
 *         exp = 0
 *         num_segments = self._spline.length - 1
 *         interpoltype = self.__class__.__name__.lower()             # <<<<<<<<<<<<<<
 *         for i in range(num_segments):
 *             yield (float(self._spline.xs[i]), float(self._spline.ys[i]), interpoltype, 0)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_interpoltype = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3290
 *         num_segments = self._spline.length - 1
 *         interpoltype = self.__class__.__name__.lower()
 *         for i in range(num_segments):             # <<<<<<<<<<<<<<
 *             yield (float(self._spline.xs[i]), float(self._spline.ys[i]), interpoltype, 0)
 *         yield (float(self._spline.xs[num_segments]), float(self._spline.ys[num_segments]), '', 0)
 */
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_num_segments;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_6;

    /* "bpf4/core.pyx":3291
 *         interpoltype = self.__class__.__name__.lower()
 *         for i in range(num_segments):
 *             yield (float(self._spline.xs[i]), float(self._spline.ys[i]), interpoltype, 0)             # <<<<<<<<<<<<<<
 *         yield (float(self._spline.xs[num_segments]), float(self._spline.ys[num_segments]), '', 0)
 * 
 */
    __pyx_t_1 = PyFloat_FromDouble(((double)(__pyx_cur_scope->__pyx_v_self->_spline->xs[__pyx_cur_scope->__pyx_v_i]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyFloat_FromDouble(((double)(__pyx_cur_scope->__pyx_v_self->_spline->ys[__pyx_cur_scope->__pyx_v_i]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_interpoltype);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_interpoltype);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_interpoltype);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_int_0);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3291, __pyx_L1_error)
  }

  /* "bpf4/core.pyx":3292
 *         for i in range(num_segments):
 *             yield (float(self._spline.xs[i]), float(self._spline.ys[i]), interpoltype, 0)
 *         yield (float(self._spline.xs[num_segments]), float(self._spline.ys[num_segments]), '', 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = PyFloat_FromDouble(((double)(__pyx_cur_scope->__pyx_v_self->_spline->xs[__pyx_cur_scope->__pyx_v_num_segments]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyFloat_FromDouble(((double)(__pyx_cur_scope->__pyx_v_self->_spline->ys[__pyx_cur_scope->__pyx_v_num_segments]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __Pyx_INCREF(__pyx_kp_u__6);
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__6);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_int_0);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 2;
  return __pyx_r;
  __pyx_L7_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3292, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "bpf4/core.pyx":3269
 *         return self._points()
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3313
 *     cdef ndarray xs, ys
 * 
 *     def __init__(self, xs, ys):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_7USpline_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7USpline___init__[] = "\n        Args:\n            xs (ndarray): the x coord data\n            ys (ndarray): the y coord data\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_7USpline___init__;
#endif
static int __pyx_pw_4bpf4_4core_7USpline_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3313, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3313, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3313, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.USpline.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_7USpline___init__(((struct __pyx_obj_4bpf4_4core_USpline *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_7USpline___init__(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys) {
  PyObject *__pyx_v_UnivariateSpline = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  double __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  double __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":3320
 *         """
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             from scipy.interpolate import UnivariateSpline
 *         except ImportError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "bpf4/core.pyx":3321
 * 
 *         try:
 *             from scipy.interpolate import UnivariateSpline             # <<<<<<<<<<<<<<
 *         except ImportError:
 *             raise ImportError("could not import scipy. USpline is a wrapper of UnivariateSpline"
 */
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3321, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_n_s_UnivariateSpline);
      __Pyx_GIVEREF(__pyx_n_s_UnivariateSpline);
      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_UnivariateSpline);
      __pyx_t_5 = __Pyx_Import(__pyx_n_s_scipy_interpolate, __pyx_t_4, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3321, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_UnivariateSpline); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3321, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_UnivariateSpline = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "bpf4/core.pyx":3320
 *         """
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             from scipy.interpolate import UnivariateSpline
 *         except ImportError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bpf4/core.pyx":3322
 *         try:
 *             from scipy.interpolate import UnivariateSpline
 *         except ImportError:             # <<<<<<<<<<<<<<
 *             raise ImportError("could not import scipy. USpline is a wrapper of UnivariateSpline"
 *                               " and cant be used without scipy")
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("bpf4.core.USpline.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 3322, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);

      /* "bpf4/core.pyx":3323
 *             from scipy.interpolate import UnivariateSpline
 *         except ImportError:
 *             raise ImportError("could not import scipy. USpline is a wrapper of UnivariateSpline"             # <<<<<<<<<<<<<<
 *                               " and cant be used without scipy")
 *         self.spline = UnivariateSpline(xs, ys)
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3323, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(0, 3323, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "bpf4/core.pyx":3320
 *         """
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             from scipy.interpolate import UnivariateSpline
 *         except ImportError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "bpf4/core.pyx":3325
 *             raise ImportError("could not import scipy. USpline is a wrapper of UnivariateSpline"
 *                               " and cant be used without scipy")
 *         self.spline = UnivariateSpline(xs, ys)             # <<<<<<<<<<<<<<
 *         self.spline__call__ = self.spline.__call__
 *         self.xs = numpy.asarray(xs)
 */
  __Pyx_INCREF(__pyx_v_UnivariateSpline);
  __pyx_t_4 = __pyx_v_UnivariateSpline; __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_xs, __pyx_v_ys};
    __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3325, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_7);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_xs, __pyx_v_ys};
    __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3325, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_7);
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_xs);
    __Pyx_GIVEREF(__pyx_v_xs);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_v_xs);
    __Pyx_INCREF(__pyx_v_ys);
    __Pyx_GIVEREF(__pyx_v_ys);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_v_ys);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF(__pyx_v_self->spline);
  __Pyx_DECREF(__pyx_v_self->spline);
  __pyx_v_self->spline = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "bpf4/core.pyx":3326
 *                               " and cant be used without scipy")
 *         self.spline = UnivariateSpline(xs, ys)
 *         self.spline__call__ = self.spline.__call__             # <<<<<<<<<<<<<<
 *         self.xs = numpy.asarray(xs)
 *         self.ys = numpy.asarray(ys)
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->spline, __pyx_n_s_call); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF(__pyx_v_self->spline__call__);
  __Pyx_DECREF(__pyx_v_self->spline__call__);
  __pyx_v_self->spline__call__ = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "bpf4/core.pyx":3327
 *         self.spline = UnivariateSpline(xs, ys)
 *         self.spline__call__ = self.spline.__call__
 *         self.xs = numpy.asarray(xs)             # <<<<<<<<<<<<<<
 *         self.ys = numpy.asarray(ys)
 *         self._set_bounds(xs[0], xs[len(xs) - 1])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_v_xs) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_xs);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3327, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF(__pyx_v_self->xs);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->xs));
  __pyx_v_self->xs = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "bpf4/core.pyx":3328
 *         self.spline__call__ = self.spline.__call__
 *         self.xs = numpy.asarray(xs)
 *         self.ys = numpy.asarray(ys)             # <<<<<<<<<<<<<<
 *         self._set_bounds(xs[0], xs[len(xs) - 1])
 *         self._integration_mode = 1  # use quad
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_ys) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_ys);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3328, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF(__pyx_v_self->ys);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->ys));
  __pyx_v_self->ys = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "bpf4/core.pyx":3329
 *         self.xs = numpy.asarray(xs)
 *         self.ys = numpy.asarray(ys)
 *         self._set_bounds(xs[0], xs[len(xs) - 1])             # <<<<<<<<<<<<<<
 *         self._integration_mode = 1  # use quad
 * 
 */
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_xs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_10 = PyObject_Length(__pyx_v_xs); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3329, __pyx_L1_error)
  __pyx_t_11 = (__pyx_t_10 - 1);
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_xs, __pyx_t_11, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_t_9, __pyx_t_12);

  /* "bpf4/core.pyx":3330
 *         self.ys = numpy.asarray(ys)
 *         self._set_bounds(xs[0], xs[len(xs) - 1])
 *         self._integration_mode = 1  # use quad             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, x):
 */
  __pyx_v_self->__pyx_base._integration_mode = 1;

  /* "bpf4/core.pyx":3313
 *     cdef ndarray xs, ys
 * 
 *     def __init__(self, xs, ys):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bpf4.core.USpline.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_UnivariateSpline);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3332
 *         self._integration_mode = 1  # use quad
 * 
 *     def __call__(self, x):             # <<<<<<<<<<<<<<
 *         return self.spline(x)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7USpline_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_7USpline_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 3332, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3332, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.USpline.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_7USpline_2__call__(((struct __pyx_obj_4bpf4_4core_USpline *)__pyx_v_self), __pyx_v_x);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7USpline_2__call__(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "bpf4/core.pyx":3333
 * 
 *     def __call__(self, x):
 *         return self.spline(x)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->spline);
  __pyx_t_2 = __pyx_v_self->spline; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_x);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3332
 *         self._integration_mode = 1  # use quad
 * 
 *     def __call__(self, x):             # <<<<<<<<<<<<<<
 *         return self.spline(x)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.USpline.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3335
 *         return self.spline(x)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         with gil:
 *             return self.spline__call__(x)
 */

static double __pyx_f_4bpf4_4core_7USpline___ccall__(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, double __pyx_v_x) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("__ccall__", 0);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif

  /* "bpf4/core.pyx":3336
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         with gil:             # <<<<<<<<<<<<<<
 *             return self.spline__call__(x)
 * 
 */
  /*try:*/ {
    {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
        #endif
        /*try:*/ {

          /* "bpf4/core.pyx":3337
 *     cdef double __ccall__(self, double x) nogil:
 *         with gil:
 *             return self.spline__call__(x)             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):
 */
          __pyx_t_2 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3337, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_self->spline__call__);
          __pyx_t_3 = __pyx_v_self->spline__call__; __pyx_t_4 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3337, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3337, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_r = __pyx_t_5;
          goto __pyx_L6_return;
        }

        /* "bpf4/core.pyx":3336
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         with gil:             # <<<<<<<<<<<<<<
 *             return self.spline__call__(x)
 * 
 */
        /*finally:*/ {
          __pyx_L6_return: {
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            goto __pyx_L3_return;
          }
          __pyx_L7_error: {
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            goto __pyx_L4_error;
          }
        }
    }
  }
  /*finally:*/ {
    __pyx_L3_return: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L0;
    }
    __pyx_L4_error: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L1_error;
    }
  }

  /* "bpf4/core.pyx":3335
 *         return self.spline(x)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         with gil:
 *             return self.spline__call__(x)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("bpf4.core.USpline.__ccall__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
  __pyx_r = 0;
  __pyx_L0:;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "bpf4/core.pyx":3339
 *             return self.spline__call__(x)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if out is not None:
 *             out[...] = self.spline__call__(xs)
 */

static PyObject *__pyx_pw_4bpf4_4core_7USpline_5map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_7USpline_map(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7USpline_map *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_7USpline_5map)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3339, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3339, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3339, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(__pyx_v_xs);
          __Pyx_GIVEREF(__pyx_v_xs);
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_xs);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_out));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3339, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3339, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3340
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):
 *         if out is not None:             # <<<<<<<<<<<<<<
 *             out[...] = self.spline__call__(xs)
 *             return out
 */
  __pyx_t_7 = (((PyObject *)__pyx_v_out) != Py_None);
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "bpf4/core.pyx":3341
 *     cpdef ndarray map(self, xs, ndarray out=None):
 *         if out is not None:
 *             out[...] = self.spline__call__(xs)             # <<<<<<<<<<<<<<
 *             return out
 *         else:
 */
    __Pyx_INCREF(__pyx_v_self->spline__call__);
    __pyx_t_2 = __pyx_v_self->spline__call__; __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_xs) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_xs);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_out), Py_Ellipsis, __pyx_t_1) < 0)) __PYX_ERR(0, 3341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bpf4/core.pyx":3342
 *         if out is not None:
 *             out[...] = self.spline__call__(xs)
 *             return out             # <<<<<<<<<<<<<<
 *         else:
 *             return self.spline__call__(xs)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = __pyx_v_out;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3340
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):
 *         if out is not None:             # <<<<<<<<<<<<<<
 *             out[...] = self.spline__call__(xs)
 *             return out
 */
  }

  /* "bpf4/core.pyx":3344
 *             return out
 *         else:
 *             return self.spline__call__(xs)             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(__pyx_v_self->spline__call__);
    __pyx_t_2 = __pyx_v_self->spline__call__; __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_xs) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_xs);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3344, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":3339
 *             return self.spline__call__(x)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if out is not None:
 *             out[...] = self.spline__call__(xs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core.USpline.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7USpline_5map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7USpline_4map[] = "USpline.map(self, xs, ndarray out=None) -> ndarray";
static PyMethodDef __pyx_mdef_4bpf4_4core_7USpline_5map = {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7USpline_5map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7USpline_4map};
static PyObject *__pyx_pw_4bpf4_4core_7USpline_5map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_out,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 3339, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_out = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3339, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.USpline.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 3339, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_7USpline_4map(((struct __pyx_obj_4bpf4_4core_USpline *)__pyx_v_self), __pyx_v_xs, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7USpline_4map(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_USpline->__pyx_base.map(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_xs, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.USpline.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3346
 *             return self.spline__call__(xs)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */

static PyObject *__pyx_pw_4bpf4_4core_7USpline_7mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_7USpline_mapn_between(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7USpline_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  PyObject *__pyx_v_xs = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_7USpline_7mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3346, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3346, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3346, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3346, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3346, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3346, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3346, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3346, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3363
 *         """
 * 
 *         xs = numpy.linspace(x0, x1, n)             # <<<<<<<<<<<<<<
 *         return self.map(xs, out)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_linspace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_2, __pyx_t_9, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3363, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_2, __pyx_t_9, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3363, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_8, __pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_9 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_xs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3364
 * 
 *         xs = numpy.linspace(x0, x1, n)
 *         return self.map(xs, out)             # <<<<<<<<<<<<<<
 * 
 *     property _spline:
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_10.__pyx_n = 1;
  __pyx_t_10.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_USpline *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.map(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_xs, 0, &__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3346
 *             return self.spline__call__(xs)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bpf4.core.USpline.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xs);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7USpline_7mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_7USpline_6mapn_between[] = "USpline.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray\n\n        Return an array of `n` elements resulting of evaluating this bpf regularly\n\n        The x coordinates at which this bpf is evaluated are equivalent to `linspace(x0, x1, n)`\n\n        Args:\n            n (int): the number of elements to generate\n            x0 (float): x to start mapping\n            x1 (float): x to end mapping\n            out (ndarray): if given, result is put here\n\n        Returns:\n            (ndarray) An array of this bpf evaluated at a grid [xstart:xend:dx], where *dx*\n            is `(xend-xstart)/n`\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7USpline_7mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7USpline_7mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7USpline_6mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_7USpline_7mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 3346, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 3346, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 3346, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3346, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3346, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3346, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3346, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.USpline.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 3346, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_7USpline_6mapn_between(((struct __pyx_obj_4bpf4_4core_USpline *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7USpline_6mapn_between(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_USpline->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.USpline.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3367
 * 
 *     property _spline:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.spline
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7USpline_7_spline_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_7USpline_7_spline_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7USpline_7_spline___get__(((struct __pyx_obj_4bpf4_4core_USpline *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7USpline_7_spline___get__(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bpf4/core.pyx":3368
 *     property _spline:
 *         def __get__(self):
 *             return self.spline             # <<<<<<<<<<<<<<
 * 
 *     def segments(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->spline);
  __pyx_r = __pyx_v_self->spline;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3367
 * 
 *     property _spline:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.spline
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_4bpf4_4core_7USpline_10generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "bpf4/core.pyx":3370
 *             return self.spline
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7USpline_9segments(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_7USpline_8segments[] = "USpline.segments(self)\n\n        Returns an iterator over the segments of this bpf\n\n        Returns:\n            (Iterable[tuple[float, float, str, float]]) An iterator of segments, \n            where each segment has the form `(x, y, interpoltype:str, exponent)`\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_7USpline_9segments = {"segments", (PyCFunction)__pyx_pw_4bpf4_4core_7USpline_9segments, METH_NOARGS, __pyx_doc_4bpf4_4core_7USpline_8segments};
static PyObject *__pyx_pw_4bpf4_4core_7USpline_9segments(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segments (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_7USpline_8segments(((struct __pyx_obj_4bpf4_4core_USpline *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_7USpline_8segments(struct __pyx_obj_4bpf4_4core_USpline *__pyx_v_self) {
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segments", 0);
  __pyx_cur_scope = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments *)__pyx_tp_new_4bpf4_4core___pyx_scope_struct_3_segments(__pyx_ptype_4bpf4_4core___pyx_scope_struct_3_segments, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3370, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4bpf4_4core_7USpline_10generator3, __pyx_codeobj__31, (PyObject *) __pyx_cur_scope, __pyx_n_s_segments, __pyx_n_s_USpline_segments, __pyx_n_s_bpf4_core); if (unlikely(!gen)) __PYX_ERR(0, 3370, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core.USpline.segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4bpf4_4core_7USpline_10generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments *__pyx_cur_scope = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  size_t __pyx_t_6;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segments", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    case 2: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3370, __pyx_L1_error)

  /* "bpf4/core.pyx":3381
 *         cdef size_t i
 *         cdef size_t num_segments
 *         exp = 0             # <<<<<<<<<<<<<<
 *         num_segments = len(self.xs) - 1
 *         interpoltype = self.__class__.__name__.lower()
 */
  __pyx_cur_scope->__pyx_v_exp = 0;

  /* "bpf4/core.pyx":3382
 *         cdef size_t num_segments
 *         exp = 0
 *         num_segments = len(self.xs) - 1             # <<<<<<<<<<<<<<
 *         interpoltype = self.__class__.__name__.lower()
 *         for i in range(num_segments):
 */
  __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_v_self->xs);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3382, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_cur_scope->__pyx_v_num_segments = (__pyx_t_2 - 1);

  /* "bpf4/core.pyx":3383
 *         exp = 0
 *         num_segments = len(self.xs) - 1
 *         interpoltype = self.__class__.__name__.lower()             # <<<<<<<<<<<<<<
 *         for i in range(num_segments):
 *             yield (float(self.xs[i]), float(self.ys[i]), interpoltype, 0)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_interpoltype = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3384
 *         num_segments = len(self.xs) - 1
 *         interpoltype = self.__class__.__name__.lower()
 *         for i in range(num_segments):             # <<<<<<<<<<<<<<
 *             yield (float(self.xs[i]), float(self.ys[i]), interpoltype, 0)
 *         yield (float(self.xs[num_segments]), float(self.ys[num_segments]), '', 0)
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_num_segments;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_7;

    /* "bpf4/core.pyx":3385
 *         interpoltype = self.__class__.__name__.lower()
 *         for i in range(num_segments):
 *             yield (float(self.xs[i]), float(self.ys[i]), interpoltype, 0)             # <<<<<<<<<<<<<<
 *         yield (float(self.xs[num_segments]), float(self.ys[num_segments]), '', 0)
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->xs), __pyx_cur_scope->__pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->ys), __pyx_cur_scope->__pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_interpoltype);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_interpoltype);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_v_interpoltype);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_int_0);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_5;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_6;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_6 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_7 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3385, __pyx_L1_error)
  }

  /* "bpf4/core.pyx":3386
 *         for i in range(num_segments):
 *             yield (float(self.xs[i]), float(self.ys[i]), interpoltype, 0)
 *         yield (float(self.xs[num_segments]), float(self.ys[num_segments]), '', 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->xs), __pyx_cur_scope->__pyx_v_num_segments, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->ys), __pyx_cur_scope->__pyx_v_num_segments, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_INCREF(__pyx_kp_u__6);
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__6);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_int_0);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 2;
  return __pyx_r;
  __pyx_L7_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3386, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "bpf4/core.pyx":3370
 *             return self.spline
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3393
 *     cdef BpfInterface b
 *     cdef double splitpoint
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         if x < self.splitpoint:
 *             return self.a.__ccall__(x)
 */

static double __pyx_f_4bpf4_4core_11_BpfConcat2___ccall__(struct __pyx_obj_4bpf4_4core__BpfConcat2 *__pyx_v_self, double __pyx_v_x) {
  double __pyx_r;
  int __pyx_t_1;

  /* "bpf4/core.pyx":3394
 *     cdef double splitpoint
 *     cdef double __ccall__(self, double x) nogil:
 *         if x < self.splitpoint:             # <<<<<<<<<<<<<<
 *             return self.a.__ccall__(x)
 *         return self.b.__ccall__(x)
 */
  __pyx_t_1 = ((__pyx_v_x < __pyx_v_self->splitpoint) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":3395
 *     cdef double __ccall__(self, double x) nogil:
 *         if x < self.splitpoint:
 *             return self.a.__ccall__(x)             # <<<<<<<<<<<<<<
 *         return self.b.__ccall__(x)
 * 
 */
    __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->a, __pyx_v_x);
    goto __pyx_L0;

    /* "bpf4/core.pyx":3394
 *     cdef double splitpoint
 *     cdef double __ccall__(self, double x) nogil:
 *         if x < self.splitpoint:             # <<<<<<<<<<<<<<
 *             return self.a.__ccall__(x)
 *         return self.b.__ccall__(x)
 */
  }

  /* "bpf4/core.pyx":3396
 *         if x < self.splitpoint:
 *             return self.a.__ccall__(x)
 *         return self.b.__ccall__(x)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->b->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->b, __pyx_v_x);
  goto __pyx_L0;

  /* "bpf4/core.pyx":3393
 *     cdef BpfInterface b
 *     cdef double splitpoint
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         if x < self.splitpoint:
 *             return self.a.__ccall__(x)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":3398
 *         return self.b.__ccall__(x)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b, self.splitpoint
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_11_BpfConcat2_1__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_11_BpfConcat2___getstate__[] = "_BpfConcat2.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_11_BpfConcat2_1__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_11_BpfConcat2_1__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_11_BpfConcat2___getstate__};
static PyObject *__pyx_pw_4bpf4_4core_11_BpfConcat2_1__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_11_BpfConcat2___getstate__(((struct __pyx_obj_4bpf4_4core__BpfConcat2 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_11_BpfConcat2___getstate__(struct __pyx_obj_4bpf4_4core__BpfConcat2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":3399
 * 
 *     def __getstate__(self):
 *         return self.a, self.b, self.splitpoint             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->splitpoint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->a));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->a));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->b));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->b));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->b));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3398
 *         return self.b.__ccall__(x)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b, self.splitpoint
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core._BpfConcat2.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3401
 *         return self.a, self.b, self.splitpoint
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.a, self.b, self.splitpoint = state
 *         cdef double x0 = self.a._x0 if self.a._x0 < self.b._x0 else self.b._x0
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_11_BpfConcat2_3__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_4bpf4_4core_11_BpfConcat2_2__setstate__[] = "_BpfConcat2.__setstate__(self, state)";
static PyMethodDef __pyx_mdef_4bpf4_4core_11_BpfConcat2_3__setstate__ = {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_11_BpfConcat2_3__setstate__, METH_O, __pyx_doc_4bpf4_4core_11_BpfConcat2_2__setstate__};
static PyObject *__pyx_pw_4bpf4_4core_11_BpfConcat2_3__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_11_BpfConcat2_2__setstate__(((struct __pyx_obj_4bpf4_4core__BpfConcat2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_11_BpfConcat2_2__setstate__(struct __pyx_obj_4bpf4_4core__BpfConcat2 *__pyx_v_self, PyObject *__pyx_v_state) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  double __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "bpf4/core.pyx":3402
 * 
 *     def __setstate__(self, state):
 *         self.a, self.b, self.splitpoint = state             # <<<<<<<<<<<<<<
 *         cdef double x0 = self.a._x0 if self.a._x0 < self.b._x0 else self.b._x0
 *         cdef double x1 = self.b._x1 if self.b._x1 > self.a._x1 else self.a._x1
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_state))) || (PyList_CheckExact(__pyx_v_state))) {
    PyObject* sequence = __pyx_v_state;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3402, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_v_state); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) __PYX_ERR(0, 3402, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3402, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 3402, __pyx_L1_error)
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 3402, __pyx_L1_error)
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3402, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->a);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->a));
  __pyx_v_self->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->b);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->b));
  __pyx_v_self->b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_v_self->splitpoint = __pyx_t_6;

  /* "bpf4/core.pyx":3403
 *     def __setstate__(self, state):
 *         self.a, self.b, self.splitpoint = state
 *         cdef double x0 = self.a._x0 if self.a._x0 < self.b._x0 else self.b._x0             # <<<<<<<<<<<<<<
 *         cdef double x1 = self.b._x1 if self.b._x1 > self.a._x1 else self.a._x1
 *         self._set_bounds(x0, x1)
 */
  if (((__pyx_v_self->a->_x0 < __pyx_v_self->b->_x0) != 0)) {
    __pyx_t_6 = __pyx_v_self->a->_x0;
  } else {
    __pyx_t_6 = __pyx_v_self->b->_x0;
  }
  __pyx_v_x0 = __pyx_t_6;

  /* "bpf4/core.pyx":3404
 *         self.a, self.b, self.splitpoint = state
 *         cdef double x0 = self.a._x0 if self.a._x0 < self.b._x0 else self.b._x0
 *         cdef double x1 = self.b._x1 if self.b._x1 > self.a._x1 else self.a._x1             # <<<<<<<<<<<<<<
 *         self._set_bounds(x0, x1)
 * 
 */
  if (((__pyx_v_self->b->_x1 > __pyx_v_self->a->_x1) != 0)) {
    __pyx_t_6 = __pyx_v_self->b->_x1;
  } else {
    __pyx_t_6 = __pyx_v_self->a->_x1;
  }
  __pyx_v_x1 = __pyx_t_6;

  /* "bpf4/core.pyx":3405
 *         cdef double x0 = self.a._x0 if self.a._x0 < self.b._x0 else self.b._x0
 *         cdef double x1 = self.b._x1 if self.b._x1 > self.a._x1 else self.a._x1
 *         self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":3401
 *         return self.a, self.b, self.splitpoint
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.a, self.b, self.splitpoint = state
 *         cdef double x0 = self.a._x0 if self.a._x0 < self.b._x0 else self.b._x0
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfConcat2.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3425
 *     cdef public double offset
 * 
 *     def __init__(self, double slope, double offset=0, tuple bounds=None):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf representing a linear equation `y = slope * x + offset`
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_5Slope_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_5Slope___init__[] = "\n        A bpf representing a linear equation `y = slope * x + offset`\n\n        Args:\n            slope (float): the slope of the line\n            offset (float): an offset added \n            bounds (tuple): if given, the line is clipped on the x axis to the\n                given bounds\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_5Slope___init__;
#endif
static int __pyx_pw_4bpf4_4core_5Slope_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_slope;
  double __pyx_v_offset;
  PyObject *__pyx_v_bounds = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_slope,&__pyx_n_s_offset,&__pyx_n_s_bounds,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject*)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_slope)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bounds);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3425, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_slope = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_slope == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_offset = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_offset == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
    } else {
      __pyx_v_offset = ((double)0.0);
    }
    __pyx_v_bounds = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3425, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Slope.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bounds), (&PyTuple_Type), 1, "bounds", 1))) __PYX_ERR(0, 3425, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_5Slope___init__(((struct __pyx_obj_4bpf4_4core_Slope *)__pyx_v_self), __pyx_v_slope, __pyx_v_offset, __pyx_v_bounds);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_5Slope___init__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, double __pyx_v_slope, double __pyx_v_offset, PyObject *__pyx_v_bounds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  double __pyx_t_3;
  double __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":3436
 *         """
 * 
 *         self.slope = slope             # <<<<<<<<<<<<<<
 *         self.offset = offset
 *         if bounds is not None:
 */
  __pyx_v_self->slope = __pyx_v_slope;

  /* "bpf4/core.pyx":3437
 * 
 *         self.slope = slope
 *         self.offset = offset             # <<<<<<<<<<<<<<
 *         if bounds is not None:
 *             self._set_bounds(bounds[0], bounds[1])
 */
  __pyx_v_self->offset = __pyx_v_offset;

  /* "bpf4/core.pyx":3438
 *         self.slope = slope
 *         self.offset = offset
 *         if bounds is not None:             # <<<<<<<<<<<<<<
 *             self._set_bounds(bounds[0], bounds[1])
 *         else:
 */
  __pyx_t_1 = (__pyx_v_bounds != ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":3439
 *         self.offset = offset
 *         if bounds is not None:
 *             self._set_bounds(bounds[0], bounds[1])             # <<<<<<<<<<<<<<
 *         else:
 *             self._set_bounds(INFNEG, INF)
 */
    if (unlikely(__pyx_v_bounds == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 3439, __pyx_L1_error)
    }
    __pyx_t_3 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_bounds, 0)); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3439, __pyx_L1_error)
    if (unlikely(__pyx_v_bounds == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 3439, __pyx_L1_error)
    }
    __pyx_t_4 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_bounds, 1)); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3439, __pyx_L1_error)
    __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_t_3, __pyx_t_4);

    /* "bpf4/core.pyx":3438
 *         self.slope = slope
 *         self.offset = offset
 *         if bounds is not None:             # <<<<<<<<<<<<<<
 *             self._set_bounds(bounds[0], bounds[1])
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":3441
 *             self._set_bounds(bounds[0], bounds[1])
 *         else:
 *             self._set_bounds(INFNEG, INF)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  /*else*/ {
    __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), (-Py_HUGE_VAL), Py_HUGE_VAL);
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":3425
 *     cdef public double offset
 * 
 *     def __init__(self, double slope, double offset=0, tuple bounds=None):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf representing a linear equation `y = slope * x + offset`
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core.Slope.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3443
 *             self._set_bounds(INFNEG, INF)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         return self.offset + x*self.slope
 * 
 */

static double __pyx_f_4bpf4_4core_5Slope___ccall__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, double __pyx_v_x) {
  double __pyx_r;

  /* "bpf4/core.pyx":3444
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         return self.offset + x*self.slope             # <<<<<<<<<<<<<<
 * 
 *     cpdef Slope _slice(self, double x0, double x1):
 */
  __pyx_r = (__pyx_v_self->offset + (__pyx_v_x * __pyx_v_self->slope));
  goto __pyx_L0;

  /* "bpf4/core.pyx":3443
 *             self._set_bounds(INFNEG, INF)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         return self.offset + x*self.slope
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":3446
 *         return self.offset + x*self.slope
 * 
 *     cpdef Slope _slice(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         return Slope(self.slope, self.offset, bounds=(x0, x1))
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_5Slope_3_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
struct __pyx_obj_4bpf4_4core_Slope *__pyx_f_4bpf4_4core_5Slope__slice(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core_Slope *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_slice", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_slice); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3446, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_5Slope_3_slice)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3446, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3446, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3446, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3446, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3446, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3446, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_Slope))))) __PYX_ERR(0, 3446, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_Slope *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3447
 * 
 *     cpdef Slope _slice(self, double x0, double x1):
 *         return Slope(self.slope, self.offset, bounds=(x0, x1))             # <<<<<<<<<<<<<<
 * 
 *     def __add__(a, b):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->slope); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
  __pyx_t_1 = 0;
  __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bounds, __pyx_t_4) < 0) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Slope), __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_Slope *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3446
 *         return self.offset + x*self.slope
 * 
 *     cpdef Slope _slice(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         return Slope(self.slope, self.offset, bounds=(x0, x1))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bpf4.core.Slope._slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Slope_3_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_5Slope_2_slice[] = "Slope._slice(self, double x0, double x1) -> Slope";
static PyMethodDef __pyx_mdef_4bpf4_4core_5Slope_3_slice = {"_slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_5Slope_3_slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_5Slope_2_slice};
static PyObject *__pyx_pw_4bpf4_4core_5Slope_3_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_slice", 1, 2, 2, 1); __PYX_ERR(0, 3446, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_slice") < 0)) __PYX_ERR(0, 3446, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3446, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3446, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_slice", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3446, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Slope._slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_5Slope_2_slice(((struct __pyx_obj_4bpf4_4core_Slope *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Slope_2_slice(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_slice", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_5Slope__slice(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Slope._slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

struct __pyx_obj_4bpf4_4core_Slope *__pyx_f_4bpf4_4core_5Slope__slice__pyx_wrap_1(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch) {
  return __pyx_f_4bpf4_4core_5Slope__slice(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, __pyx_skip_dispatch);
}

/* "bpf4/core.pyx":3449
 *         return Slope(self.slope, self.offset, bounds=(x0, x1))
 * 
 *     def __add__(a, b):             # <<<<<<<<<<<<<<
 *         if isnumber(a):
 *             # we are b
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Slope_5__add__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_5Slope_5__add__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Slope_4__add__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Slope_4__add__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__add__", 0);

  /* "bpf4/core.pyx":3450
 * 
 *     def __add__(a, b):
 *         if isnumber(a):             # <<<<<<<<<<<<<<
 *             # we are b
 *             return Slope(b.slope, b.offset + a, b.bounds())
 */
  __pyx_t_1 = (__pyx_f_4bpf4_4core_isnumber(__pyx_v_a) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":3452
 *         if isnumber(a):
 *             # we are b
 *             return Slope(b.slope, b.offset + a, b.bounds())             # <<<<<<<<<<<<<<
 *         elif isnumber(b):
 *             return Slope(a.slope, a.offset + b, a.bounds())
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_slope); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_v_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_bounds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Slope), __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3450
 * 
 *     def __add__(a, b):
 *         if isnumber(a):             # <<<<<<<<<<<<<<
 *             # we are b
 *             return Slope(b.slope, b.offset + a, b.bounds())
 */
  }

  /* "bpf4/core.pyx":3453
 *             # we are b
 *             return Slope(b.slope, b.offset + a, b.bounds())
 *         elif isnumber(b):             # <<<<<<<<<<<<<<
 *             return Slope(a.slope, a.offset + b, a.bounds())
 *         else:
 */
  __pyx_t_1 = (__pyx_f_4bpf4_4core_isnumber(__pyx_v_b) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":3454
 *             return Slope(b.slope, b.offset + a, b.bounds())
 *         elif isnumber(b):
 *             return Slope(a.slope, a.offset + b, a.bounds())             # <<<<<<<<<<<<<<
 *         else:
 *             return _create_lambda(a, b, _BpfLambdaAdd, _BpfLambdaAddConst)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_slope); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_bounds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Slope), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3453
 *             # we are b
 *             return Slope(b.slope, b.offset + a, b.bounds())
 *         elif isnumber(b):             # <<<<<<<<<<<<<<
 *             return Slope(a.slope, a.offset + b, a.bounds())
 *         else:
 */
  }

  /* "bpf4/core.pyx":3456
 *             return Slope(a.slope, a.offset + b, a.bounds())
 *         else:
 *             return _create_lambda(a, b, _BpfLambdaAdd, _BpfLambdaAddConst)             # <<<<<<<<<<<<<<
 * 
 *     def __sub__(a, b):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    if (!(likely(((__pyx_v_a) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 3456, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_4bpf4_4core__create_lambda(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_a), __pyx_v_b, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaAdd), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaAddConst)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":3449
 *         return Slope(self.slope, self.offset, bounds=(x0, x1))
 * 
 *     def __add__(a, b):             # <<<<<<<<<<<<<<
 *         if isnumber(a):
 *             # we are b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core.Slope.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3458
 *             return _create_lambda(a, b, _BpfLambdaAdd, _BpfLambdaAddConst)
 * 
 *     def __sub__(a, b):             # <<<<<<<<<<<<<<
 *         if isnumber(a):
 *             return b + (-a)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Slope_7__sub__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_5Slope_7__sub__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Slope_6__sub__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Slope_6__sub__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_4bpf4_4core__create_rlambda __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__sub__", 0);

  /* "bpf4/core.pyx":3459
 * 
 *     def __sub__(a, b):
 *         if isnumber(a):             # <<<<<<<<<<<<<<
 *             return b + (-a)
 *         elif isnumber(b):
 */
  __pyx_t_1 = (__pyx_f_4bpf4_4core_isnumber(__pyx_v_a) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":3460
 *     def __sub__(a, b):
 *         if isnumber(a):
 *             return b + (-a)             # <<<<<<<<<<<<<<
 *         elif isnumber(b):
 *             return a + (-b)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyNumber_Negative(__pyx_v_a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Add(__pyx_v_b, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3459
 * 
 *     def __sub__(a, b):
 *         if isnumber(a):             # <<<<<<<<<<<<<<
 *             return b + (-a)
 *         elif isnumber(b):
 */
  }

  /* "bpf4/core.pyx":3461
 *         if isnumber(a):
 *             return b + (-a)
 *         elif isnumber(b):             # <<<<<<<<<<<<<<
 *             return a + (-b)
 *         else:
 */
  __pyx_t_1 = (__pyx_f_4bpf4_4core_isnumber(__pyx_v_b) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":3462
 *             return b + (-a)
 *         elif isnumber(b):
 *             return a + (-b)             # <<<<<<<<<<<<<<
 *         else:
 *             return _create_rlambda(a, b, _BpfLambdaSub, _BpfLambdaSubConst, _BpfLambdaRSub, _BpfLambdaRSubConst)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyNumber_Negative(__pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Add(__pyx_v_a, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3461
 *         if isnumber(a):
 *             return b + (-a)
 *         elif isnumber(b):             # <<<<<<<<<<<<<<
 *             return a + (-b)
 *         else:
 */
  }

  /* "bpf4/core.pyx":3464
 *             return a + (-b)
 *         else:
 *             return _create_rlambda(a, b, _BpfLambdaSub, _BpfLambdaSubConst, _BpfLambdaRSub, _BpfLambdaRSubConst)             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.class_rbin = ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRSub);
    __pyx_t_4.class_rconst = ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRSubConst);
    __pyx_t_2 = __pyx_f_4bpf4_4core__create_rlambda(__pyx_v_a, __pyx_v_b, ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaSub), ((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaSubConst), &__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":3458
 *             return _create_lambda(a, b, _BpfLambdaAdd, _BpfLambdaAddConst)
 * 
 *     def __sub__(a, b):             # <<<<<<<<<<<<<<
 *         if isnumber(a):
 *             return b + (-a)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.Slope.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3466
 *             return _create_rlambda(a, b, _BpfLambdaSub, _BpfLambdaSubConst, _BpfLambdaRSub, _BpfLambdaRSubConst)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */

static PyObject *__pyx_pw_4bpf4_4core_5Slope_9mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_5Slope_mapn_between(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_5Slope_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  __Pyx_memviewslice __pyx_v_result = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_offset;
  double __pyx_v_slope;
  int __pyx_v_i;
  double __pyx_v_dx;
  double __pyx_v_slopex0;
  double __pyx_v_slopedx;
  double __pyx_v_offset2;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_11;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_5Slope_9mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3466, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3466, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3466, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3466, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3466, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3466, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3466, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3466, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3483
 * 
 *         """
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)             # <<<<<<<<<<<<<<
 *         cdef double offset = self.offset
 *         cdef double slope = self.slope
 */
  __pyx_t_11 = (((PyObject *)__pyx_v_out) != Py_None);
  if ((__pyx_t_11 != 0)) {
    __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(((PyObject *)__pyx_v_out), PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 3483, __pyx_L1_error)
    __pyx_t_10 = __pyx_t_12;
    __pyx_t_12.memview = NULL;
    __pyx_t_12.data = NULL;
  } else {
    __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 3483, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_t_12;
    __pyx_t_12.memview = NULL;
    __pyx_t_12.data = NULL;
  }
  __pyx_v_result = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "bpf4/core.pyx":3484
 *         """
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)
 *         cdef double offset = self.offset             # <<<<<<<<<<<<<<
 *         cdef double slope = self.slope
 *         cdef int i
 */
  __pyx_t_13 = __pyx_v_self->offset;
  __pyx_v_offset = __pyx_t_13;

  /* "bpf4/core.pyx":3485
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)
 *         cdef double offset = self.offset
 *         cdef double slope = self.slope             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef double x
 */
  __pyx_t_13 = __pyx_v_self->slope;
  __pyx_v_slope = __pyx_t_13;

  /* "bpf4/core.pyx":3488
 *         cdef int i
 *         cdef double x
 *         cdef double dx = _ntodx(n, x0, x1)             # <<<<<<<<<<<<<<
 *         cdef double slopex0 = slope * x0
 *         cdef double slopedx = slope * dx
 */
  __pyx_v_dx = __pyx_f_4bpf4_4core__ntodx(__pyx_v_n, __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":3489
 *         cdef double x
 *         cdef double dx = _ntodx(n, x0, x1)
 *         cdef double slopex0 = slope * x0             # <<<<<<<<<<<<<<
 *         cdef double slopedx = slope * dx
 *         cdef double offset2 = offset + slopex0
 */
  __pyx_v_slopex0 = (__pyx_v_slope * __pyx_v_x0);

  /* "bpf4/core.pyx":3490
 *         cdef double dx = _ntodx(n, x0, x1)
 *         cdef double slopex0 = slope * x0
 *         cdef double slopedx = slope * dx             # <<<<<<<<<<<<<<
 *         cdef double offset2 = offset + slopex0
 *         with nogil:
 */
  __pyx_v_slopedx = (__pyx_v_slope * __pyx_v_dx);

  /* "bpf4/core.pyx":3491
 *         cdef double slopex0 = slope * x0
 *         cdef double slopedx = slope * dx
 *         cdef double offset2 = offset + slopex0             # <<<<<<<<<<<<<<
 *         with nogil:
 *             for i in range(n):
 */
  __pyx_v_offset2 = (__pyx_v_offset + __pyx_v_slopex0);

  /* "bpf4/core.pyx":3492
 *         cdef double slopedx = slope * dx
 *         cdef double offset2 = offset + slopex0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for i in range(n):
 *                 # x = x0 + i * dx
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "bpf4/core.pyx":3493
 *         cdef double offset2 = offset + slopex0
 *         with nogil:
 *             for i in range(n):             # <<<<<<<<<<<<<<
 *                 # x = x0 + i * dx
 *                 # y = offset + (x0 + i*dx)*slope
 */
        __pyx_t_8 = __pyx_v_n;
        __pyx_t_14 = __pyx_t_8;
        for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
          __pyx_v_i = __pyx_t_15;

          /* "bpf4/core.pyx":3497
 *                 # y = offset + (x0 + i*dx)*slope
 *                 # y = offset + slope*x0 + i*(dx*slope)
 *                 result[i] = offset2 + i * slopedx             # <<<<<<<<<<<<<<
 *         return numpy.asarray(result)
 * 
 */
          __pyx_t_16 = __pyx_v_i;
          *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_result.data) + __pyx_t_16)) )) = (__pyx_v_offset2 + (__pyx_v_i * __pyx_v_slopedx));
        }
      }

      /* "bpf4/core.pyx":3492
 *         cdef double slopedx = slope * dx
 *         cdef double offset2 = offset + slopex0
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for i in range(n):
 *                 # x = x0 + i * dx
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "bpf4/core.pyx":3498
 *                 # y = offset + slope*x0 + i*(dx*slope)
 *                 result[i] = offset2 + i * slopedx
 *         return numpy.asarray(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_result, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3498, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3466
 *             return _create_rlambda(a, b, _BpfLambdaSub, _BpfLambdaSubConst, _BpfLambdaRSub, _BpfLambdaRSubConst)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
  __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_AddTraceback("bpf4.core.Slope.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Slope_9mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_5Slope_8mapn_between[] = "Slope.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray\n\n        Return an array of `n` elements resulting of evaluating this bpf regularly\n\n        The x coordinates at which this bpf is evaluated are equivalent to `linspace(x0, 1, n)`\n\n        Args:\n            n (int): the number of elements to generate\n            x0 (float): x to start mapping\n            x1 (float): x to end mapping\n            out (ndarray): if given, result is put here\n\n        Returns:\n            (ndarray) An array of this bpf evaluated at a grid [x0:x1:dx], where *dx*\n            is `(xend-xstart)/n`\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_5Slope_9mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_5Slope_9mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_5Slope_8mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_5Slope_9mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 3466, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 3466, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 3466, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3466, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3466, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3466, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3466, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Slope.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 3466, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_5Slope_8mapn_between(((struct __pyx_obj_4bpf4_4core_Slope *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Slope_8mapn_between(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_Slope->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Slope.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3501
 * 
 * 
 *     def __mul__(a, b):             # <<<<<<<<<<<<<<
 *         if isnumber(a):
 *             return Slope(b.slope*a, b.offset*a, b.bounds())
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Slope_11__mul__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_5Slope_11__mul__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Slope_10__mul__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Slope_10__mul__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__mul__", 0);

  /* "bpf4/core.pyx":3502
 * 
 *     def __mul__(a, b):
 *         if isnumber(a):             # <<<<<<<<<<<<<<
 *             return Slope(b.slope*a, b.offset*a, b.bounds())
 *         elif isnumber(b):
 */
  __pyx_t_1 = (__pyx_f_4bpf4_4core_isnumber(__pyx_v_a) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":3503
 *     def __mul__(a, b):
 *         if isnumber(a):
 *             return Slope(b.slope*a, b.offset*a, b.bounds())             # <<<<<<<<<<<<<<
 *         elif isnumber(b):
 *             return Slope(a.slope*b, a.offset*b, a.bounds())
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_slope); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_v_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_bounds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Slope), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3502
 * 
 *     def __mul__(a, b):
 *         if isnumber(a):             # <<<<<<<<<<<<<<
 *             return Slope(b.slope*a, b.offset*a, b.bounds())
 *         elif isnumber(b):
 */
  }

  /* "bpf4/core.pyx":3504
 *         if isnumber(a):
 *             return Slope(b.slope*a, b.offset*a, b.bounds())
 *         elif isnumber(b):             # <<<<<<<<<<<<<<
 *             return Slope(a.slope*b, a.offset*b, a.bounds())
 *         return BpfInterface.__mul__(a, b)
 */
  __pyx_t_1 = (__pyx_f_4bpf4_4core_isnumber(__pyx_v_b) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":3505
 *             return Slope(b.slope*a, b.offset*a, b.bounds())
 *         elif isnumber(b):
 *             return Slope(a.slope*b, a.offset*b, a.bounds())             # <<<<<<<<<<<<<<
 *         return BpfInterface.__mul__(a, b)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_slope); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_v_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_v_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_bounds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
    __pyx_t_5 = 0;
    __pyx_t_4 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core_Slope), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3504
 *         if isnumber(a):
 *             return Slope(b.slope*a, b.offset*a, b.bounds())
 *         elif isnumber(b):             # <<<<<<<<<<<<<<
 *             return Slope(a.slope*b, a.offset*b, a.bounds())
 *         return BpfInterface.__mul__(a, b)
 */
  }

  /* "bpf4/core.pyx":3506
 *         elif isnumber(b):
 *             return Slope(a.slope*b, a.offset*b, a.bounds())
 *         return BpfInterface.__mul__(a, b)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface), __pyx_n_s_mul); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_a, __pyx_v_b};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3506, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_a, __pyx_v_b};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3506, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_a);
    __Pyx_GIVEREF(__pyx_v_a);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_a);
    __Pyx_INCREF(__pyx_v_b);
    __Pyx_GIVEREF(__pyx_v_b);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_b);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3501
 * 
 * 
 *     def __mul__(a, b):             # <<<<<<<<<<<<<<
 *         if isnumber(a):
 *             return Slope(b.slope*a, b.offset*a, b.bounds())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core.Slope.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3508
 *         return BpfInterface.__mul__(a, b)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.slope, self.offset, self.bounds()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Slope_13__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_5Slope_12__getstate__[] = "Slope.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_5Slope_13__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_5Slope_13__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_5Slope_12__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_5Slope_13__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Slope_12__getstate__(((struct __pyx_obj_4bpf4_4core_Slope *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Slope_12__getstate__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":3509
 * 
 *     def __getstate__(self):
 *         return self.slope, self.offset, self.bounds()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->slope); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bounds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3508
 *         return BpfInterface.__mul__(a, b)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.slope, self.offset, self.bounds()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.Slope.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3422
 *     ![](assets/slope-plot.png)
 *     """
 *     cdef public double slope             # <<<<<<<<<<<<<<
 *     cdef public double offset
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Slope_5slope_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_5Slope_5slope_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Slope_5slope___get__(((struct __pyx_obj_4bpf4_4core_Slope *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Slope_5slope___get__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->slope); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Slope.slope.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_5Slope_5slope_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4bpf4_4core_5Slope_5slope_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Slope_5slope_2__set__(((struct __pyx_obj_4bpf4_4core_Slope *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_5Slope_5slope_2__set__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3422, __pyx_L1_error)
  __pyx_v_self->slope = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core.Slope.slope.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3423
 *     """
 *     cdef public double slope
 *     cdef public double offset             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, double slope, double offset=0, tuple bounds=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Slope_6offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_5Slope_6offset_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Slope_6offset___get__(((struct __pyx_obj_4bpf4_4core_Slope *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Slope_6offset___get__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Slope.offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_5Slope_6offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4bpf4_4core_5Slope_6offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Slope_6offset_2__set__(((struct __pyx_obj_4bpf4_4core_Slope *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_5Slope_6offset_2__set__(struct __pyx_obj_4bpf4_4core_Slope *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3423, __pyx_L1_error)
  __pyx_v_self->offset = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core.Slope.offset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3519
 *     cdef BpfInterface b
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         x = self.a.__ccall__(x)
 *         return self.b.__ccall__(x)
 */

static double __pyx_f_4bpf4_4core_11_BpfCompose___ccall__(struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_v_self, double __pyx_v_x) {
  double __pyx_r;

  /* "bpf4/core.pyx":3520
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         x = self.a.__ccall__(x)             # <<<<<<<<<<<<<<
 *         return self.b.__ccall__(x)
 * 
 */
  __pyx_v_x = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->a, __pyx_v_x);

  /* "bpf4/core.pyx":3521
 *     cdef double __ccall__(self, double x) nogil:
 *         x = self.a.__ccall__(x)
 *         return self.b.__ccall__(x)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->b->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->b, __pyx_v_x);
  goto __pyx_L0;

  /* "bpf4/core.pyx":3519
 *     cdef BpfInterface b
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         x = self.a.__ccall__(x)
 *         return self.b.__ccall__(x)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":3523
 *         return self.b.__ccall__(x)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_11_BpfCompose_1__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_11_BpfCompose___getstate__[] = "_BpfCompose.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_11_BpfCompose_1__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_11_BpfCompose_1__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_11_BpfCompose___getstate__};
static PyObject *__pyx_pw_4bpf4_4core_11_BpfCompose_1__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_11_BpfCompose___getstate__(((struct __pyx_obj_4bpf4_4core__BpfCompose *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_11_BpfCompose___getstate__(struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":3524
 * 
 *     def __getstate__(self):
 *         return self.a, self.b             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->a));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->a));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->b));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->b));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->b));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3523
 *         return self.b.__ccall__(x)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfCompose.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3526
 *         return self.a, self.b
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.a, self.b = state
 *         self._set_bounds(self.a._x0, self.a._x1)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_11_BpfCompose_3__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_4bpf4_4core_11_BpfCompose_2__setstate__[] = "_BpfCompose.__setstate__(self, state)";
static PyMethodDef __pyx_mdef_4bpf4_4core_11_BpfCompose_3__setstate__ = {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_11_BpfCompose_3__setstate__, METH_O, __pyx_doc_4bpf4_4core_11_BpfCompose_2__setstate__};
static PyObject *__pyx_pw_4bpf4_4core_11_BpfCompose_3__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_11_BpfCompose_2__setstate__(((struct __pyx_obj_4bpf4_4core__BpfCompose *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_11_BpfCompose_2__setstate__(struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "bpf4/core.pyx":3527
 * 
 *     def __setstate__(self, state):
 *         self.a, self.b = state             # <<<<<<<<<<<<<<
 *         self._set_bounds(self.a._x0, self.a._x1)
 * 
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_state))) || (PyList_CheckExact(__pyx_v_state))) {
    PyObject* sequence = __pyx_v_state;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 3527, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 3527, __pyx_L1_error)
    __pyx_t_4 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 3527, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 3527, __pyx_L1_error)
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 3527, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->a);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->a));
  __pyx_v_self->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->b);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->b));
  __pyx_v_self->b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":3528
 *     def __setstate__(self, state):
 *         self.a, self.b = state
 *         self._set_bounds(self.a._x0, self.a._x1)             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_self->a->_x0, __pyx_v_self->a->_x1);

  /* "bpf4/core.pyx":3526
 *         return self.a, self.b
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.a, self.b = state
 *         self._set_bounds(self.a._x0, self.a._x1)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfCompose.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3530
 *         self._set_bounds(self.a._x0, self.a._x1)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */

static PyObject *__pyx_pw_4bpf4_4core_11_BpfCompose_5mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_11_BpfCompose_mapn_between(struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_11_BpfCompose_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  PyArrayObject *__pyx_v_A = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
  __Pyx_Buffer __pyx_pybuffer_A;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_12;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  __pyx_pybuffer_A.pybuffer.buf = NULL;
  __pyx_pybuffer_A.refcount = 0;
  __pyx_pybuffernd_A.data = NULL;
  __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_11_BpfCompose_5mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3530, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3530, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3530, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3530, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3530, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3530, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3530, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3530, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3547
 *         """
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A
 *         if out is not None:             # <<<<<<<<<<<<<<
 *             self.a.mapn_between(n, x0, x1, out)
 *             self.b.map(out, out)
 */
  __pyx_t_10 = (((PyObject *)__pyx_v_out) != Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":3548
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A
 *         if out is not None:
 *             self.a.mapn_between(n, x0, x1, out)             # <<<<<<<<<<<<<<
 *             self.b.map(out, out)
 *             return out
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.out = __pyx_v_out;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->mapn_between(__pyx_v_self->a, __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bpf4/core.pyx":3549
 *         if out is not None:
 *             self.a.mapn_between(n, x0, x1, out)
 *             self.b.map(out, out)             # <<<<<<<<<<<<<<
 *             return out
 *         else:
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.out = __pyx_v_out;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->b->__pyx_vtab)->map(__pyx_v_self->b, ((PyObject *)__pyx_v_out), 0, &__pyx_t_13)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bpf4/core.pyx":3550
 *             self.a.mapn_between(n, x0, x1, out)
 *             self.b.map(out, out)
 *             return out             # <<<<<<<<<<<<<<
 *         else:
 *             A = self.a.mapn_between(n, x0, x1)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = __pyx_v_out;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3547
 *         """
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A
 *         if out is not None:             # <<<<<<<<<<<<<<
 *             self.a.mapn_between(n, x0, x1, out)
 *             self.b.map(out, out)
 */
  }

  /* "bpf4/core.pyx":3552
 *             return out
 *         else:
 *             A = self.a.mapn_between(n, x0, x1)             # <<<<<<<<<<<<<<
 *             self.b.map(A, A)
 *             return A
 */
  /*else*/ {
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->mapn_between(__pyx_v_self->a, __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 0, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
      __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_8 < 0)) {
        PyErr_Fetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
        }
        __pyx_t_14 = __pyx_t_15 = __pyx_t_16 = 0;
      }
      __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 3552, __pyx_L1_error)
    }
    __pyx_v_A = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "bpf4/core.pyx":3553
 *         else:
 *             A = self.a.mapn_between(n, x0, x1)
 *             self.b.map(A, A)             # <<<<<<<<<<<<<<
 *             return A
 * 
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.out = ((PyArrayObject *)__pyx_v_A);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->b->__pyx_vtab)->map(__pyx_v_self->b, ((PyObject *)__pyx_v_A), 0, &__pyx_t_13)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bpf4/core.pyx":3554
 *             A = self.a.mapn_between(n, x0, x1)
 *             self.b.map(A, A)
 *             return A             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_A));
    __pyx_r = ((PyArrayObject *)__pyx_v_A);
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":3530
 *         self._set_bounds(self.a._x0, self.a._x1)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core._BpfCompose.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_A);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_11_BpfCompose_5mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_11_BpfCompose_4mapn_between[] = "_BpfCompose.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray\n\n        Return an array of `n` elements resulting of evaluating this bpf regularly\n\n        The x coordinates at which this bpf is evaluated are equivalent to `linspace(x0, 1, n)`\n\n        Args:\n            n (int): the number of elements to generate\n            x0 (float): x to start mapping\n            x1 (float): x to end mapping\n            out (ndarray): if given, result is put here\n\n        Returns:\n            (ndarray) An array of this bpf evaluated at a grid [x0:x1:dx], where *dx*\n            is `(xend-xstart)/n`\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_11_BpfCompose_5mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_11_BpfCompose_5mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_11_BpfCompose_4mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_11_BpfCompose_5mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 3530, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 3530, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 3530, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3530, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3530, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3530, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3530, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfCompose.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 3530, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_11_BpfCompose_4mapn_between(((struct __pyx_obj_4bpf4_4core__BpfCompose *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_11_BpfCompose_4mapn_between(struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__BpfCompose->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfCompose.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3557
 * 
 * 
 * cdef _BpfCompose _BpfCompose_new(BpfInterface a, BpfInterface b):             # <<<<<<<<<<<<<<
 *     cdef _BpfCompose self = _BpfCompose()
 *     self.a = a
 */

static struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_f_4bpf4_4core__BpfCompose_new(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b) {
  struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_v_self = 0;
  struct __pyx_obj_4bpf4_4core__BpfCompose *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_BpfCompose_new", 0);

  /* "bpf4/core.pyx":3558
 * 
 * cdef _BpfCompose _BpfCompose_new(BpfInterface a, BpfInterface b):
 *     cdef _BpfCompose self = _BpfCompose()             # <<<<<<<<<<<<<<
 *     self.a = a
 *     self.b = b
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfCompose)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_self = ((struct __pyx_obj_4bpf4_4core__BpfCompose *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3559
 * cdef _BpfCompose _BpfCompose_new(BpfInterface a, BpfInterface b):
 *     cdef _BpfCompose self = _BpfCompose()
 *     self.a = a             # <<<<<<<<<<<<<<
 *     self.b = b
 *     self._set_bounds(a._x0, a._x1)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_a));
  __Pyx_GOTREF(__pyx_v_self->a);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->a));
  __pyx_v_self->a = __pyx_v_a;

  /* "bpf4/core.pyx":3560
 *     cdef _BpfCompose self = _BpfCompose()
 *     self.a = a
 *     self.b = b             # <<<<<<<<<<<<<<
 *     self._set_bounds(a._x0, a._x1)
 *     return self
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_b));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_b));
  __Pyx_GOTREF(__pyx_v_self->b);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->b));
  __pyx_v_self->b = __pyx_v_b;

  /* "bpf4/core.pyx":3561
 *     self.a = a
 *     self.b = b
 *     self._set_bounds(a._x0, a._x1)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_a->_x0, __pyx_v_a->_x1);

  /* "bpf4/core.pyx":3562
 *     self.b = b
 *     self._set_bounds(a._x0, a._x1)
 *     return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3557
 * 
 * 
 * cdef _BpfCompose _BpfCompose_new(BpfInterface a, BpfInterface b):             # <<<<<<<<<<<<<<
 *     cdef _BpfCompose self = _BpfCompose()
 *     self.a = a
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfCompose_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3565
 * 
 * 
 * cdef _BpfConcat2 _BpfConcat2_new(BpfInterface bpf_a, BpfInterface bpf_b, double splitpoint):             # <<<<<<<<<<<<<<
 *     cdef _BpfConcat2 self = _BpfConcat2()
 *     cdef double x0 = bpf_a._x0 if bpf_a._x0 < bpf_b._x0 else bpf_b._x0
 */

static struct __pyx_obj_4bpf4_4core__BpfConcat2 *__pyx_f_4bpf4_4core__BpfConcat2_new(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf_a, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf_b, double __pyx_v_splitpoint) {
  struct __pyx_obj_4bpf4_4core__BpfConcat2 *__pyx_v_self = 0;
  double __pyx_v_x0;
  double __pyx_v_x1;
  struct __pyx_obj_4bpf4_4core__BpfConcat2 *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  double __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_BpfConcat2_new", 0);

  /* "bpf4/core.pyx":3566
 * 
 * cdef _BpfConcat2 _BpfConcat2_new(BpfInterface bpf_a, BpfInterface bpf_b, double splitpoint):
 *     cdef _BpfConcat2 self = _BpfConcat2()             # <<<<<<<<<<<<<<
 *     cdef double x0 = bpf_a._x0 if bpf_a._x0 < bpf_b._x0 else bpf_b._x0
 *     cdef double x1 = bpf_b._x1 if bpf_b._x1 > bpf_a._x1 else bpf_a._x1
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfConcat2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_self = ((struct __pyx_obj_4bpf4_4core__BpfConcat2 *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3567
 * cdef _BpfConcat2 _BpfConcat2_new(BpfInterface bpf_a, BpfInterface bpf_b, double splitpoint):
 *     cdef _BpfConcat2 self = _BpfConcat2()
 *     cdef double x0 = bpf_a._x0 if bpf_a._x0 < bpf_b._x0 else bpf_b._x0             # <<<<<<<<<<<<<<
 *     cdef double x1 = bpf_b._x1 if bpf_b._x1 > bpf_a._x1 else bpf_a._x1
 *     self._set_bounds(x0, x1)
 */
  if (((__pyx_v_bpf_a->_x0 < __pyx_v_bpf_b->_x0) != 0)) {
    __pyx_t_2 = __pyx_v_bpf_a->_x0;
  } else {
    __pyx_t_2 = __pyx_v_bpf_b->_x0;
  }
  __pyx_v_x0 = __pyx_t_2;

  /* "bpf4/core.pyx":3568
 *     cdef _BpfConcat2 self = _BpfConcat2()
 *     cdef double x0 = bpf_a._x0 if bpf_a._x0 < bpf_b._x0 else bpf_b._x0
 *     cdef double x1 = bpf_b._x1 if bpf_b._x1 > bpf_a._x1 else bpf_a._x1             # <<<<<<<<<<<<<<
 *     self._set_bounds(x0, x1)
 *     self.a = bpf_a
 */
  if (((__pyx_v_bpf_b->_x1 > __pyx_v_bpf_a->_x1) != 0)) {
    __pyx_t_2 = __pyx_v_bpf_b->_x1;
  } else {
    __pyx_t_2 = __pyx_v_bpf_a->_x1;
  }
  __pyx_v_x1 = __pyx_t_2;

  /* "bpf4/core.pyx":3569
 *     cdef double x0 = bpf_a._x0 if bpf_a._x0 < bpf_b._x0 else bpf_b._x0
 *     cdef double x1 = bpf_b._x1 if bpf_b._x1 > bpf_a._x1 else bpf_a._x1
 *     self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 *     self.a = bpf_a
 *     self.b = bpf_b
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":3570
 *     cdef double x1 = bpf_b._x1 if bpf_b._x1 > bpf_a._x1 else bpf_a._x1
 *     self._set_bounds(x0, x1)
 *     self.a = bpf_a             # <<<<<<<<<<<<<<
 *     self.b = bpf_b
 *     self.splitpoint = splitpoint
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_bpf_a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_bpf_a));
  __Pyx_GOTREF(__pyx_v_self->a);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->a));
  __pyx_v_self->a = __pyx_v_bpf_a;

  /* "bpf4/core.pyx":3571
 *     self._set_bounds(x0, x1)
 *     self.a = bpf_a
 *     self.b = bpf_b             # <<<<<<<<<<<<<<
 *     self.splitpoint = splitpoint
 *     return self
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_bpf_b));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_bpf_b));
  __Pyx_GOTREF(__pyx_v_self->b);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->b));
  __pyx_v_self->b = __pyx_v_bpf_b;

  /* "bpf4/core.pyx":3572
 *     self.a = bpf_a
 *     self.b = bpf_b
 *     self.splitpoint = splitpoint             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  __pyx_v_self->splitpoint = __pyx_v_splitpoint;

  /* "bpf4/core.pyx":3573
 *     self.b = bpf_b
 *     self.splitpoint = splitpoint
 *     return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3565
 * 
 * 
 * cdef _BpfConcat2 _BpfConcat2_new(BpfInterface bpf_a, BpfInterface bpf_b, double splitpoint):             # <<<<<<<<<<<<<<
 *     cdef _BpfConcat2 self = _BpfConcat2()
 *     cdef double x0 = bpf_a._x0 if bpf_a._x0 < bpf_b._x0 else bpf_b._x0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfConcat2_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3586
 *     cdef BpfInterface last_bpf, bpf0, bpf1
 * 
 *     def __cinit__(self, xs, bpfs):             # <<<<<<<<<<<<<<
 *         self.size = len(xs)
 *         self.xs = <double *>malloc(sizeof(double) * self.size)
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_10_BpfConcat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_10_BpfConcat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  CYTHON_UNUSED PyObject *__pyx_v_bpfs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_bpfs,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpfs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 3586, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 3586, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_xs = values[0];
    __pyx_v_bpfs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3586, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfConcat.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_10_BpfConcat___cinit__(((struct __pyx_obj_4bpf4_4core__BpfConcat *)__pyx_v_self), __pyx_v_xs, __pyx_v_bpfs);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_10_BpfConcat___cinit__(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self, PyObject *__pyx_v_xs, CYTHON_UNUSED PyObject *__pyx_v_bpfs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "bpf4/core.pyx":3587
 * 
 *     def __cinit__(self, xs, bpfs):
 *         self.size = len(xs)             # <<<<<<<<<<<<<<
 *         self.xs = <double *>malloc(sizeof(double) * self.size)
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_xs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3587, __pyx_L1_error)
  __pyx_v_self->size = __pyx_t_1;

  /* "bpf4/core.pyx":3588
 *     def __cinit__(self, xs, bpfs):
 *         self.size = len(xs)
 *         self.xs = <double *>malloc(sizeof(double) * self.size)             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, xs, bpfs):
 */
  __pyx_v_self->xs = ((double *)malloc(((sizeof(double)) * __pyx_v_self->size)));

  /* "bpf4/core.pyx":3586
 *     cdef BpfInterface last_bpf, bpf0, bpf1
 * 
 *     def __cinit__(self, xs, bpfs):             # <<<<<<<<<<<<<<
 *         self.size = len(xs)
 *         self.xs = <double *>malloc(sizeof(double) * self.size)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core._BpfConcat.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3590
 *         self.xs = <double *>malloc(sizeof(double) * self.size)
 * 
 *     def __init__(self, xs, bpfs):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_10_BpfConcat_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_10_BpfConcat_2__init__[] = "\n        Args:\n            xs (list|ndarray):  the offset of each bpf\n            bpfs (list[BpfInterface]): a list of bpfs to concatenate\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_10_BpfConcat_2__init__;
#endif
static int __pyx_pw_4bpf4_4core_10_BpfConcat_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_bpfs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_bpfs,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpfs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3590, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3590, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_xs = values[0];
    __pyx_v_bpfs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3590, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfConcat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_10_BpfConcat_2__init__(((struct __pyx_obj_4bpf4_4core__BpfConcat *)__pyx_v_self), __pyx_v_xs, __pyx_v_bpfs);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_10_BpfConcat_2__init__(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_bpfs) {
  int __pyx_v_i;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf = 0;
  PyObject *__pyx_v_x = NULL;
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":3598
 *         cdef int i
 *         cdef BpfInterface bpf
 *         self.bpfs = list(bpfs)             # <<<<<<<<<<<<<<
 *         i = 0
 *         for x in xs:
 */
  __pyx_t_1 = PySequence_List(__pyx_v_bpfs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->bpfs);
  __Pyx_DECREF(__pyx_v_self->bpfs);
  __pyx_v_self->bpfs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3599
 *         cdef BpfInterface bpf
 *         self.bpfs = list(bpfs)
 *         i = 0             # <<<<<<<<<<<<<<
 *         for x in xs:
 *             self.xs[i] = x
 */
  __pyx_v_i = 0;

  /* "bpf4/core.pyx":3600
 *         self.bpfs = list(bpfs)
 *         i = 0
 *         for x in xs:             # <<<<<<<<<<<<<<
 *             self.xs[i] = x
 *             i += 1
 */
  if (likely(PyList_CheckExact(__pyx_v_xs)) || PyTuple_CheckExact(__pyx_v_xs)) {
    __pyx_t_1 = __pyx_v_xs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_xs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3600, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3600, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 3600, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 3600, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "bpf4/core.pyx":3601
 *         i = 0
 *         for x in xs:
 *             self.xs[i] = x             # <<<<<<<<<<<<<<
 *             i += 1
 *         cdef double x0 = INF
 */
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_x); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3601, __pyx_L1_error)
    (__pyx_v_self->xs[__pyx_v_i]) = __pyx_t_5;

    /* "bpf4/core.pyx":3602
 *         for x in xs:
 *             self.xs[i] = x
 *             i += 1             # <<<<<<<<<<<<<<
 *         cdef double x0 = INF
 *         cdef double x1 = INFNEG
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "bpf4/core.pyx":3600
 *         self.bpfs = list(bpfs)
 *         i = 0
 *         for x in xs:             # <<<<<<<<<<<<<<
 *             self.xs[i] = x
 *             i += 1
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3603
 *             self.xs[i] = x
 *             i += 1
 *         cdef double x0 = INF             # <<<<<<<<<<<<<<
 *         cdef double x1 = INFNEG
 *         for i in range(self.size):
 */
  __pyx_v_x0 = Py_HUGE_VAL;

  /* "bpf4/core.pyx":3604
 *             i += 1
 *         cdef double x0 = INF
 *         cdef double x1 = INFNEG             # <<<<<<<<<<<<<<
 *         for i in range(self.size):
 *             bpf = self.bpfs[i]
 */
  __pyx_v_x1 = (-Py_HUGE_VAL);

  /* "bpf4/core.pyx":3605
 *         cdef double x0 = INF
 *         cdef double x1 = INFNEG
 *         for i in range(self.size):             # <<<<<<<<<<<<<<
 *             bpf = self.bpfs[i]
 *             if bpf._x0 < x0:
 */
  __pyx_t_2 = __pyx_v_self->size;
  __pyx_t_6 = __pyx_t_2;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "bpf4/core.pyx":3606
 *         cdef double x1 = INFNEG
 *         for i in range(self.size):
 *             bpf = self.bpfs[i]             # <<<<<<<<<<<<<<
 *             if bpf._x0 < x0:
 *                 x0 = bpf._x0
 */
    if (unlikely(__pyx_v_self->bpfs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 3606, __pyx_L1_error)
    }
    if (!(likely(((PyList_GET_ITEM(__pyx_v_self->bpfs, __pyx_v_i)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_self->bpfs, __pyx_v_i), __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 3606, __pyx_L1_error)
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_self->bpfs, __pyx_v_i);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_bpf, ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "bpf4/core.pyx":3607
 *         for i in range(self.size):
 *             bpf = self.bpfs[i]
 *             if bpf._x0 < x0:             # <<<<<<<<<<<<<<
 *                 x0 = bpf._x0
 *             if bpf._x1 > x1:
 */
    __pyx_t_8 = ((__pyx_v_bpf->_x0 < __pyx_v_x0) != 0);
    if (__pyx_t_8) {

      /* "bpf4/core.pyx":3608
 *             bpf = self.bpfs[i]
 *             if bpf._x0 < x0:
 *                 x0 = bpf._x0             # <<<<<<<<<<<<<<
 *             if bpf._x1 > x1:
 *                 x1 = bpf._x1
 */
      __pyx_t_5 = __pyx_v_bpf->_x0;
      __pyx_v_x0 = __pyx_t_5;

      /* "bpf4/core.pyx":3607
 *         for i in range(self.size):
 *             bpf = self.bpfs[i]
 *             if bpf._x0 < x0:             # <<<<<<<<<<<<<<
 *                 x0 = bpf._x0
 *             if bpf._x1 > x1:
 */
    }

    /* "bpf4/core.pyx":3609
 *             if bpf._x0 < x0:
 *                 x0 = bpf._x0
 *             if bpf._x1 > x1:             # <<<<<<<<<<<<<<
 *                 x1 = bpf._x1
 *         self._set_bounds(x0, x1)
 */
    __pyx_t_8 = ((__pyx_v_bpf->_x1 > __pyx_v_x1) != 0);
    if (__pyx_t_8) {

      /* "bpf4/core.pyx":3610
 *                 x0 = bpf._x0
 *             if bpf._x1 > x1:
 *                 x1 = bpf._x1             # <<<<<<<<<<<<<<
 *         self._set_bounds(x0, x1)
 *         self.bpf0 = self.bpfs[0]
 */
      __pyx_t_5 = __pyx_v_bpf->_x1;
      __pyx_v_x1 = __pyx_t_5;

      /* "bpf4/core.pyx":3609
 *             if bpf._x0 < x0:
 *                 x0 = bpf._x0
 *             if bpf._x1 > x1:             # <<<<<<<<<<<<<<
 *                 x1 = bpf._x1
 *         self._set_bounds(x0, x1)
 */
    }
  }

  /* "bpf4/core.pyx":3611
 *             if bpf._x1 > x1:
 *                 x1 = bpf._x1
 *         self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 *         self.bpf0 = self.bpfs[0]
 *         self.bpf1 = self.bpfs[self.size - 1]
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":3612
 *                 x1 = bpf._x1
 *         self._set_bounds(x0, x1)
 *         self.bpf0 = self.bpfs[0]             # <<<<<<<<<<<<<<
 *         self.bpf1 = self.bpfs[self.size - 1]
 *         self.last_bpf = self.bpf0
 */
  if (unlikely(__pyx_v_self->bpfs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 3612, __pyx_L1_error)
  }
  if (!(likely(((PyList_GET_ITEM(__pyx_v_self->bpfs, 0)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_self->bpfs, 0), __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 3612, __pyx_L1_error)
  __pyx_t_1 = PyList_GET_ITEM(__pyx_v_self->bpfs, 0);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->bpf0);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->bpf0));
  __pyx_v_self->bpf0 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3613
 *         self._set_bounds(x0, x1)
 *         self.bpf0 = self.bpfs[0]
 *         self.bpf1 = self.bpfs[self.size - 1]             # <<<<<<<<<<<<<<
 *         self.last_bpf = self.bpf0
 *         self.last_x0 = self.xs[0]
 */
  if (unlikely(__pyx_v_self->bpfs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 3613, __pyx_L1_error)
  }
  __pyx_t_2 = (__pyx_v_self->size - 1);
  if (!(likely(((PyList_GET_ITEM(__pyx_v_self->bpfs, __pyx_t_2)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_self->bpfs, __pyx_t_2), __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 3613, __pyx_L1_error)
  __pyx_t_1 = PyList_GET_ITEM(__pyx_v_self->bpfs, __pyx_t_2);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->bpf1);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->bpf1));
  __pyx_v_self->bpf1 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3614
 *         self.bpf0 = self.bpfs[0]
 *         self.bpf1 = self.bpfs[self.size - 1]
 *         self.last_bpf = self.bpf0             # <<<<<<<<<<<<<<
 *         self.last_x0 = self.xs[0]
 *         self.last_x1 = self.xs[1]
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->bpf0);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->last_bpf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->last_bpf));
  __pyx_v_self->last_bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3615
 *         self.bpf1 = self.bpfs[self.size - 1]
 *         self.last_bpf = self.bpf0
 *         self.last_x0 = self.xs[0]             # <<<<<<<<<<<<<<
 *         self.last_x1 = self.xs[1]
 * 
 */
  __pyx_v_self->last_x0 = (__pyx_v_self->xs[0]);

  /* "bpf4/core.pyx":3616
 *         self.last_bpf = self.bpf0
 *         self.last_x0 = self.xs[0]
 *         self.last_x1 = self.xs[1]             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->last_x1 = (__pyx_v_self->xs[1]);

  /* "bpf4/core.pyx":3590
 *         self.xs = <double *>malloc(sizeof(double) * self.size)
 * 
 *     def __init__(self, xs, bpfs):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfConcat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_bpf);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3618
 *         self.last_x1 = self.xs[1]
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.xs)
 * 
 */

/* Python wrapper */
static void __pyx_pw_4bpf4_4core_10_BpfConcat_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_4bpf4_4core_10_BpfConcat_5__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_4bpf4_4core_10_BpfConcat_4__dealloc__(((struct __pyx_obj_4bpf4_4core__BpfConcat *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_4bpf4_4core_10_BpfConcat_4__dealloc__(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "bpf4/core.pyx":3619
 * 
 *     def __dealloc__(self):
 *         free(self.xs)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  free(__pyx_v_self->xs);

  /* "bpf4/core.pyx":3618
 *         self.last_x1 = self.xs[1]
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.xs)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":3621
 *         free(self.xs)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef int index
 *         if x <= self._x0:
 */

static double __pyx_f_4bpf4_4core_10_BpfConcat___ccall__(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self, double __pyx_v_x) {
  int __pyx_v_index;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("__ccall__", 0);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif

  /* "bpf4/core.pyx":3622
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef int index             # <<<<<<<<<<<<<<
 *         if x <= self._x0:
 *             return self.bpf0.__ccall__(x)
 */
  /*try:*/ {

    /* "bpf4/core.pyx":3623
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef int index
 *         if x <= self._x0:             # <<<<<<<<<<<<<<
 *             return self.bpf0.__ccall__(x)
 *         elif x >= self._x1:
 */
    __pyx_t_1 = ((__pyx_v_x <= __pyx_v_self->__pyx_base._x0) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":3624
 *         cdef int index
 *         if x <= self._x0:
 *             return self.bpf0.__ccall__(x)             # <<<<<<<<<<<<<<
 *         elif x >= self._x1:
 *             return self.bpf1.__ccall__(x)
 */
      __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf0->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf0, __pyx_v_x);
      goto __pyx_L3_return;

      /* "bpf4/core.pyx":3623
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef int index
 *         if x <= self._x0:             # <<<<<<<<<<<<<<
 *             return self.bpf0.__ccall__(x)
 *         elif x >= self._x1:
 */
    }

    /* "bpf4/core.pyx":3625
 *         if x <= self._x0:
 *             return self.bpf0.__ccall__(x)
 *         elif x >= self._x1:             # <<<<<<<<<<<<<<
 *             return self.bpf1.__ccall__(x)
 *         elif x >= self.last_x0 and x < self.last_x1:
 */
    __pyx_t_1 = ((__pyx_v_x >= __pyx_v_self->__pyx_base._x1) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":3626
 *             return self.bpf0.__ccall__(x)
 *         elif x >= self._x1:
 *             return self.bpf1.__ccall__(x)             # <<<<<<<<<<<<<<
 *         elif x >= self.last_x0 and x < self.last_x1:
 *             return self.last_bpf.__ccall__(x)
 */
      __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf1->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf1, __pyx_v_x);
      goto __pyx_L3_return;

      /* "bpf4/core.pyx":3625
 *         if x <= self._x0:
 *             return self.bpf0.__ccall__(x)
 *         elif x >= self._x1:             # <<<<<<<<<<<<<<
 *             return self.bpf1.__ccall__(x)
 *         elif x >= self.last_x0 and x < self.last_x1:
 */
    }

    /* "bpf4/core.pyx":3627
 *         elif x >= self._x1:
 *             return self.bpf1.__ccall__(x)
 *         elif x >= self.last_x0 and x < self.last_x1:             # <<<<<<<<<<<<<<
 *             return self.last_bpf.__ccall__(x)
 *         else:
 */
    __pyx_t_2 = ((__pyx_v_x >= __pyx_v_self->last_x0) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_x < __pyx_v_self->last_x1) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":3628
 *             return self.bpf1.__ccall__(x)
 *         elif x >= self.last_x0 and x < self.last_x1:
 *             return self.last_bpf.__ccall__(x)             # <<<<<<<<<<<<<<
 *         else:
 *             index = _csearchsorted_left(self.xs, self.size, x) - 1
 */
      __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->last_bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->last_bpf, __pyx_v_x);
      goto __pyx_L3_return;

      /* "bpf4/core.pyx":3627
 *         elif x >= self._x1:
 *             return self.bpf1.__ccall__(x)
 *         elif x >= self.last_x0 and x < self.last_x1:             # <<<<<<<<<<<<<<
 *             return self.last_bpf.__ccall__(x)
 *         else:
 */
    }

    /* "bpf4/core.pyx":3630
 *             return self.last_bpf.__ccall__(x)
 *         else:
 *             index = _csearchsorted_left(self.xs, self.size, x) - 1             # <<<<<<<<<<<<<<
 *             with gil:
 *                 self.last_bpf = self.bpfs[index]
 */
    /*else*/ {
      __pyx_v_index = (__pyx_f_4bpf4_4core__csearchsorted_left(__pyx_v_self->xs, __pyx_v_self->size, __pyx_v_x) - 1);

      /* "bpf4/core.pyx":3631
 *         else:
 *             index = _csearchsorted_left(self.xs, self.size, x) - 1
 *             with gil:             # <<<<<<<<<<<<<<
 *                 self.last_bpf = self.bpfs[index]
 *             self.last_x0 = self.xs[index]
 */
      {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          #endif
          /*try:*/ {

            /* "bpf4/core.pyx":3632
 *             index = _csearchsorted_left(self.xs, self.size, x) - 1
 *             with gil:
 *                 self.last_bpf = self.bpfs[index]             # <<<<<<<<<<<<<<
 *             self.last_x0 = self.xs[index]
 *             self.last_x1 = self.xs[index+1]
 */
            if (unlikely(__pyx_v_self->bpfs == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              __PYX_ERR(0, 3632, __pyx_L10_error)
            }
            if (!(likely(((PyList_GET_ITEM(__pyx_v_self->bpfs, __pyx_v_index)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_self->bpfs, __pyx_v_index), __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 3632, __pyx_L10_error)
            __pyx_t_3 = PyList_GET_ITEM(__pyx_v_self->bpfs, __pyx_v_index);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_GOTREF(__pyx_v_self->last_bpf);
            __Pyx_DECREF(((PyObject *)__pyx_v_self->last_bpf));
            __pyx_v_self->last_bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_3);
            __pyx_t_3 = 0;
          }

          /* "bpf4/core.pyx":3631
 *         else:
 *             index = _csearchsorted_left(self.xs, self.size, x) - 1
 *             with gil:             # <<<<<<<<<<<<<<
 *                 self.last_bpf = self.bpfs[index]
 *             self.last_x0 = self.xs[index]
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_PyGILState_Release(__pyx_gilstate_save);
              #endif
              goto __pyx_L11;
            }
            __pyx_L10_error: {
              #ifdef WITH_THREAD
              __Pyx_PyGILState_Release(__pyx_gilstate_save);
              #endif
              goto __pyx_L4_error;
            }
            __pyx_L11:;
          }
      }

      /* "bpf4/core.pyx":3633
 *             with gil:
 *                 self.last_bpf = self.bpfs[index]
 *             self.last_x0 = self.xs[index]             # <<<<<<<<<<<<<<
 *             self.last_x1 = self.xs[index+1]
 *             return self.last_bpf.__ccall__(x)
 */
      __pyx_v_self->last_x0 = (__pyx_v_self->xs[__pyx_v_index]);

      /* "bpf4/core.pyx":3634
 *                 self.last_bpf = self.bpfs[index]
 *             self.last_x0 = self.xs[index]
 *             self.last_x1 = self.xs[index+1]             # <<<<<<<<<<<<<<
 *             return self.last_bpf.__ccall__(x)
 * 
 */
      __pyx_v_self->last_x1 = (__pyx_v_self->xs[(__pyx_v_index + 1)]);

      /* "bpf4/core.pyx":3635
 *             self.last_x0 = self.xs[index]
 *             self.last_x1 = self.xs[index+1]
 *             return self.last_bpf.__ccall__(x)             # <<<<<<<<<<<<<<
 * 
 *     cpdef BpfInterface concat(self, BpfInterface other, double fadetime=0, fadeshape='expon(3)'):
 */
      __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->last_bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->last_bpf, __pyx_v_x);
      goto __pyx_L3_return;
    }
  }

  /* "bpf4/core.pyx":3622
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef int index             # <<<<<<<<<<<<<<
 *         if x <= self._x0:
 *             return self.bpf0.__ccall__(x)
 */
  /*finally:*/ {
    __pyx_L3_return: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L0;
    }
    __pyx_L4_error: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L1_error;
    }
  }

  /* "bpf4/core.pyx":3621
 *         free(self.xs)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef int index
 *         if x <= self._x0:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("bpf4.core._BpfConcat.__ccall__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
  __pyx_r = 0;
  __pyx_L0:;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "bpf4/core.pyx":3637
 *             return self.last_bpf.__ccall__(x)
 * 
 *     cpdef BpfInterface concat(self, BpfInterface other, double fadetime=0, fadeshape='expon(3)'):             # <<<<<<<<<<<<<<
 *         cdef BpfInterface other2 = other.fit_between(self._x1, self._x1 + (other._x1 - other._x0))
 *         cdef int i
 */

static PyObject *__pyx_pw_4bpf4_4core_10_BpfConcat_7concat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_10_BpfConcat_concat(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_10_BpfConcat_concat *__pyx_optional_args) {
  double __pyx_v_fadetime = ((double)0.0);
  PyObject *__pyx_v_fadeshape = ((PyObject *)__pyx_kp_u_expon_3);
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other2 = 0;
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_bpfs = 0;
  int __pyx_8genexpr2__pyx_v_i;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("concat", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fadetime = __pyx_optional_args->fadetime;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_fadeshape = __pyx_optional_args->fadeshape;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_concat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3637, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_10_BpfConcat_7concat)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_fadetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3637, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_other), __pyx_t_3, __pyx_v_fadeshape};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3637, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_other), __pyx_t_3, __pyx_v_fadeshape};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3637, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3637, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
          __Pyx_INCREF(__pyx_v_fadeshape);
          __Pyx_GIVEREF(__pyx_v_fadeshape);
          PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_fadeshape);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3637, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 3637, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3638
 * 
 *     cpdef BpfInterface concat(self, BpfInterface other, double fadetime=0, fadeshape='expon(3)'):
 *         cdef BpfInterface other2 = other.fit_between(self._x1, self._x1 + (other._x1 - other._x0))             # <<<<<<<<<<<<<<
 *         cdef int i
 *         cdef list xs
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_other->__pyx_vtab)->fit_between(__pyx_v_other, __pyx_v_self->__pyx_base._x1, (__pyx_v_self->__pyx_base._x1 + (__pyx_v_other->_x1 - __pyx_v_other->_x0)), 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_other2 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3642
 *         cdef list xs
 *         cdef list bpfs
 *         if fadetime == 0:             # <<<<<<<<<<<<<<
 *             xs = [self.xs[i] for i in range(self.size)]
 *             bpfs = self.bpfs[:]
 */
  __pyx_t_8 = ((__pyx_v_fadetime == 0.0) != 0);
  if (__pyx_t_8) {

    /* "bpf4/core.pyx":3643
 *         cdef list bpfs
 *         if fadetime == 0:
 *             xs = [self.xs[i] for i in range(self.size)]             # <<<<<<<<<<<<<<
 *             bpfs = self.bpfs[:]
 *             bpfs.append(other2)
 */
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3643, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __pyx_v_self->size;
      __pyx_t_10 = __pyx_t_9;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_10; __pyx_t_6+=1) {
        __pyx_8genexpr2__pyx_v_i = __pyx_t_6;
        __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->xs[__pyx_8genexpr2__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3643, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 3643, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
    } /* exit inner scope */
    __pyx_v_xs = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "bpf4/core.pyx":3644
 *         if fadetime == 0:
 *             xs = [self.xs[i] for i in range(self.size)]
 *             bpfs = self.bpfs[:]             # <<<<<<<<<<<<<<
 *             bpfs.append(other2)
 *             return _BpfConcat(xs, bpfs)
 */
    if (unlikely(__pyx_v_self->bpfs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 3644, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_self->bpfs, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_bpfs = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "bpf4/core.pyx":3645
 *             xs = [self.xs[i] for i in range(self.size)]
 *             bpfs = self.bpfs[:]
 *             bpfs.append(other2)             # <<<<<<<<<<<<<<
 *             return _BpfConcat(xs, bpfs)
 *         raise NotImplementedError("fade is not implemented")
 */
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_bpfs, ((PyObject *)__pyx_v_other2)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 3645, __pyx_L1_error)

    /* "bpf4/core.pyx":3646
 *             bpfs = self.bpfs[:]
 *             bpfs.append(other2)
 *             return _BpfConcat(xs, bpfs)             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("fade is not implemented")
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_xs);
    __Pyx_GIVEREF(__pyx_v_xs);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xs);
    __Pyx_INCREF(__pyx_v_bpfs);
    __Pyx_GIVEREF(__pyx_v_bpfs);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_bpfs);
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfConcat), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3642
 *         cdef list xs
 *         cdef list bpfs
 *         if fadetime == 0:             # <<<<<<<<<<<<<<
 *             xs = [self.xs[i] for i in range(self.size)]
 *             bpfs = self.bpfs[:]
 */
  }

  /* "bpf4/core.pyx":3647
 *             bpfs.append(other2)
 *             return _BpfConcat(xs, bpfs)
 *         raise NotImplementedError("fade is not implemented")             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(0, 3647, __pyx_L1_error)

  /* "bpf4/core.pyx":3637
 *             return self.last_bpf.__ccall__(x)
 * 
 *     cpdef BpfInterface concat(self, BpfInterface other, double fadetime=0, fadeshape='expon(3)'):             # <<<<<<<<<<<<<<
 *         cdef BpfInterface other2 = other.fit_between(self._x1, self._x1 + (other._x1 - other._x0))
 *         cdef int i
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bpf4.core._BpfConcat.concat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_other2);
  __Pyx_XDECREF(__pyx_v_xs);
  __Pyx_XDECREF(__pyx_v_bpfs);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_10_BpfConcat_7concat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_10_BpfConcat_6concat[] = "_BpfConcat.concat(self, BpfInterface other, double fadetime=0, fadeshape=u'expon(3)') -> BpfInterface";
static PyMethodDef __pyx_mdef_4bpf4_4core_10_BpfConcat_7concat = {"concat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_10_BpfConcat_7concat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_10_BpfConcat_6concat};
static PyObject *__pyx_pw_4bpf4_4core_10_BpfConcat_7concat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other = 0;
  double __pyx_v_fadetime;
  PyObject *__pyx_v_fadeshape = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("concat (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_fadetime,&__pyx_n_s_fadeshape,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)__pyx_kp_u_expon_3);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fadetime);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fadeshape);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "concat") < 0)) __PYX_ERR(0, 3637, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
    if (values[1]) {
      __pyx_v_fadetime = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_fadetime == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3637, __pyx_L3_error)
    } else {
      __pyx_v_fadetime = ((double)0.0);
    }
    __pyx_v_fadeshape = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("concat", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3637, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfConcat.concat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "other", 0))) __PYX_ERR(0, 3637, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_10_BpfConcat_6concat(((struct __pyx_obj_4bpf4_4core__BpfConcat *)__pyx_v_self), __pyx_v_other, __pyx_v_fadetime, __pyx_v_fadeshape);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_10_BpfConcat_6concat(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other, double __pyx_v_fadetime, PyObject *__pyx_v_fadeshape) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_10_BpfConcat_concat __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("concat", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.fadetime = __pyx_v_fadetime;
  __pyx_t_2.fadeshape = __pyx_v_fadeshape;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__BpfConcat->concat(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfConcat.concat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_10_BpfConcat_concat__pyx_wrap_1(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_other, int __pyx_skip_dispatch) {
  return __pyx_f_4bpf4_4core_10_BpfConcat_concat(__pyx_v_self, __pyx_v_other, __pyx_skip_dispatch, NULL);
}

/* "bpf4/core.pyx":3649
 *         raise NotImplementedError("fade is not implemented")
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         cdef list xs
 *         cdef int i
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_10_BpfConcat_9__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_10_BpfConcat_8__getstate__[] = "_BpfConcat.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_10_BpfConcat_9__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_10_BpfConcat_9__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_10_BpfConcat_8__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_10_BpfConcat_9__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_10_BpfConcat_8__getstate__(((struct __pyx_obj_4bpf4_4core__BpfConcat *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_10_BpfConcat_8__getstate__(struct __pyx_obj_4bpf4_4core__BpfConcat *__pyx_v_self) {
  PyObject *__pyx_v_xs = 0;
  int __pyx_8genexpr3__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":3652
 *         cdef list xs
 *         cdef int i
 *         xs = [self.xs[i] for i in range(self.size)]             # <<<<<<<<<<<<<<
 *         return xs, self.bpfs
 * 
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_self->size;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_8genexpr3__pyx_v_i = __pyx_t_4;
      __pyx_t_5 = PyFloat_FromDouble((__pyx_v_self->xs[__pyx_8genexpr3__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3652, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 3652, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_v_xs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3653
 *         cdef int i
 *         xs = [self.xs[i] for i in range(self.size)]
 *         return xs, self.bpfs             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_xs);
  __Pyx_GIVEREF(__pyx_v_xs);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xs);
  __Pyx_INCREF(__pyx_v_self->bpfs);
  __Pyx_GIVEREF(__pyx_v_self->bpfs);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->bpfs);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3649
 *         raise NotImplementedError("fade is not implemented")
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         cdef list xs
 *         cdef int i
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core._BpfConcat.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3660
 *     cdef BpfInterface which
 * 
 *     def __init__(self, a: BpfInterface, b: BpfInterface, which: BpfInterface):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_9_BpfBlend_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_9_BpfBlend___init__[] = "\n        Args:\n            a: the first bpf\n            b: the second bpf\n            which: a bpf returning a value between 0-1; indicates the mix factor\n                at any x-point\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_9_BpfBlend___init__;
#endif
static int __pyx_pw_4bpf4_4core_9_BpfBlend_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a = 0;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b = 0;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_which = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_which,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 3660, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 3660, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3660, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
    __pyx_v_b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[1]);
    __pyx_v_which = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3660, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfBlend.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "a", 0))) __PYX_ERR(0, 3660, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "b", 0))) __PYX_ERR(0, 3660, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_which), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "which", 0))) __PYX_ERR(0, 3660, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_9_BpfBlend___init__(((struct __pyx_obj_4bpf4_4core__BpfBlend *)__pyx_v_self), __pyx_v_a, __pyx_v_b, __pyx_v_which);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_9_BpfBlend___init__(struct __pyx_obj_4bpf4_4core__BpfBlend *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_which) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  double __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":3668
 *                 at any x-point
 *         """
 *         self.a = a             # <<<<<<<<<<<<<<
 *         self.b = b
 *         self.which = which
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_a));
  __Pyx_GOTREF(__pyx_v_self->a);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->a));
  __pyx_v_self->a = __pyx_v_a;

  /* "bpf4/core.pyx":3669
 *         """
 *         self.a = a
 *         self.b = b             # <<<<<<<<<<<<<<
 *         self.which = which
 *         cdef double x0 = min(a.x0, b.x0)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_b));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_b));
  __Pyx_GOTREF(__pyx_v_self->b);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->b));
  __pyx_v_self->b = __pyx_v_b;

  /* "bpf4/core.pyx":3670
 *         self.a = a
 *         self.b = b
 *         self.which = which             # <<<<<<<<<<<<<<
 *         cdef double x0 = min(a.x0, b.x0)
 *         cdef double x1 = max(a.x1, b.x1)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_which));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_which));
  __Pyx_GOTREF(__pyx_v_self->which);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->which));
  __pyx_v_self->which = __pyx_v_which;

  /* "bpf4/core.pyx":3671
 *         self.b = b
 *         self.which = which
 *         cdef double x0 = min(a.x0, b.x0)             # <<<<<<<<<<<<<<
 *         cdef double x1 = max(a.x1, b.x1)
 *         self._set_bounds(x0, x1)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_b), __pyx_n_s_x0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_x0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3671, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3671, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3671, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_x0 = __pyx_t_6;

  /* "bpf4/core.pyx":3672
 *         self.which = which
 *         cdef double x0 = min(a.x0, b.x0)
 *         cdef double x1 = max(a.x1, b.x1)             # <<<<<<<<<<<<<<
 *         self._set_bounds(x0, x1)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_b), __pyx_n_s_x1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_x1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3672, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3672, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
  } else {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3672, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_x1 = __pyx_t_6;

  /* "bpf4/core.pyx":3673
 *         cdef double x0 = min(a.x0, b.x0)
 *         cdef double x1 = max(a.x1, b.x1)
 *         self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":3660
 *     cdef BpfInterface which
 * 
 *     def __init__(self, a: BpfInterface, b: BpfInterface, which: BpfInterface):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfBlend.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3675
 *         self._set_bounds(x0, x1)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double ya, yb, mix
 *         mix = self.which.__ccall__(x)
 */

static double __pyx_f_4bpf4_4core_9_BpfBlend___ccall__(struct __pyx_obj_4bpf4_4core__BpfBlend *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_ya;
  double __pyx_v_yb;
  double __pyx_v_mix;
  double __pyx_r;

  /* "bpf4/core.pyx":3677
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double ya, yb, mix
 *         mix = self.which.__ccall__(x)             # <<<<<<<<<<<<<<
 *         ya = self.a.__ccall__(x) * (1 - mix)
 *         yb = self.b.__ccall__(x) * mix
 */
  __pyx_v_mix = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->which->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->which, __pyx_v_x);

  /* "bpf4/core.pyx":3678
 *         cdef double ya, yb, mix
 *         mix = self.which.__ccall__(x)
 *         ya = self.a.__ccall__(x) * (1 - mix)             # <<<<<<<<<<<<<<
 *         yb = self.b.__ccall__(x) * mix
 *         return ya + yb
 */
  __pyx_v_ya = (((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->a, __pyx_v_x) * (1.0 - __pyx_v_mix));

  /* "bpf4/core.pyx":3679
 *         mix = self.which.__ccall__(x)
 *         ya = self.a.__ccall__(x) * (1 - mix)
 *         yb = self.b.__ccall__(x) * mix             # <<<<<<<<<<<<<<
 *         return ya + yb
 * 
 */
  __pyx_v_yb = (((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->b->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->b, __pyx_v_x) * __pyx_v_mix);

  /* "bpf4/core.pyx":3680
 *         ya = self.a.__ccall__(x) * (1 - mix)
 *         yb = self.b.__ccall__(x) * mix
 *         return ya + yb             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_r = (__pyx_v_ya + __pyx_v_yb);
  goto __pyx_L0;

  /* "bpf4/core.pyx":3675
 *         self._set_bounds(x0, x1)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double ya, yb, mix
 *         mix = self.which.__ccall__(x)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":3682
 *         return ya + yb
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b, self.which
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_9_BpfBlend_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_9_BpfBlend_2__getstate__[] = "_BpfBlend.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_9_BpfBlend_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_9_BpfBlend_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_9_BpfBlend_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_9_BpfBlend_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_9_BpfBlend_2__getstate__(((struct __pyx_obj_4bpf4_4core__BpfBlend *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_9_BpfBlend_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfBlend *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":3683
 * 
 *     def __getstate__(self):
 *         return self.a, self.b, self.which             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->a));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->a));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->b));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->b));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->b));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->which));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->which));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self->which));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3682
 *         return ya + yb
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b, self.which
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfBlend.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3690
 *     cdef double which
 * 
 *     def __init__(_BpfBlendConst self, BpfInterface a, BpfInterface b, double which):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_14_BpfBlendConst_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_14_BpfBlendConst___init__[] = "\n        Args:\n            a (BpfInterface): the first bpf\n            b (BpfInterface): the second bpf\n            which (float): a constant mix factor between 0-1\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_14_BpfBlendConst___init__;
#endif
static int __pyx_pw_4bpf4_4core_14_BpfBlendConst_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a = 0;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b = 0;
  double __pyx_v_which;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_which,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 3690, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 3690, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3690, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
    __pyx_v_b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[1]);
    __pyx_v_which = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_which == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3690, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3690, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfBlendConst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "a", 0))) __PYX_ERR(0, 3690, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "b", 0))) __PYX_ERR(0, 3690, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfBlendConst___init__(((struct __pyx_obj_4bpf4_4core__BpfBlendConst *)__pyx_v_self), __pyx_v_a, __pyx_v_b, __pyx_v_which);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_14_BpfBlendConst___init__(struct __pyx_obj_4bpf4_4core__BpfBlendConst *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b, double __pyx_v_which) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  double __pyx_t_2;
  double __pyx_t_3;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":3697
 *             which (float): a constant mix factor between 0-1
 *         """
 *         self.a = a             # <<<<<<<<<<<<<<
 *         self.b = b
 *         self.which = which
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_a));
  __Pyx_GOTREF(__pyx_v_self->a);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->a));
  __pyx_v_self->a = __pyx_v_a;

  /* "bpf4/core.pyx":3698
 *         """
 *         self.a = a
 *         self.b = b             # <<<<<<<<<<<<<<
 *         self.which = which
 *         cdef double x0 = min(a._x0, b._x0)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_b));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_b));
  __Pyx_GOTREF(__pyx_v_self->b);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->b));
  __pyx_v_self->b = __pyx_v_b;

  /* "bpf4/core.pyx":3699
 *         self.a = a
 *         self.b = b
 *         self.which = which             # <<<<<<<<<<<<<<
 *         cdef double x0 = min(a._x0, b._x0)
 *         cdef double x1 = max(a._x1, b._x1)
 */
  __pyx_v_self->which = __pyx_v_which;

  /* "bpf4/core.pyx":3700
 *         self.b = b
 *         self.which = which
 *         cdef double x0 = min(a._x0, b._x0)             # <<<<<<<<<<<<<<
 *         cdef double x1 = max(a._x1, b._x1)
 *         self._set_bounds(x0, x1)
 */
  __pyx_t_1 = __pyx_v_b->_x0;
  __pyx_t_2 = __pyx_v_a->_x0;
  if (((__pyx_t_1 < __pyx_t_2) != 0)) {
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_3 = __pyx_t_2;
  }
  __pyx_v_x0 = __pyx_t_3;

  /* "bpf4/core.pyx":3701
 *         self.which = which
 *         cdef double x0 = min(a._x0, b._x0)
 *         cdef double x1 = max(a._x1, b._x1)             # <<<<<<<<<<<<<<
 *         self._set_bounds(x0, x1)
 * 
 */
  __pyx_t_3 = __pyx_v_b->_x1;
  __pyx_t_1 = __pyx_v_a->_x1;
  if (((__pyx_t_3 > __pyx_t_1) != 0)) {
    __pyx_t_2 = __pyx_t_3;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_v_x1 = __pyx_t_2;

  /* "bpf4/core.pyx":3702
 *         cdef double x0 = min(a._x0, b._x0)
 *         cdef double x1 = max(a._x1, b._x1)
 *         self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":3690
 *     cdef double which
 * 
 *     def __init__(_BpfBlendConst self, BpfInterface a, BpfInterface b, double which):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3704
 *         self._set_bounds(x0, x1)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         return self.a.__ccall__(x) * (1 - self.which) + self.b.__ccall__(x) * self.which
 * 
 */

static double __pyx_f_4bpf4_4core_14_BpfBlendConst___ccall__(struct __pyx_obj_4bpf4_4core__BpfBlendConst *__pyx_v_self, double __pyx_v_x) {
  double __pyx_r;

  /* "bpf4/core.pyx":3705
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         return self.a.__ccall__(x) * (1 - self.which) + self.b.__ccall__(x) * self.which             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self): return self.a, self.b, self.which
 */
  __pyx_r = ((((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->a, __pyx_v_x) * (1.0 - __pyx_v_self->which)) + (((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->b->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->b, __pyx_v_x) * __pyx_v_self->which));
  goto __pyx_L0;

  /* "bpf4/core.pyx":3704
 *         self._set_bounds(x0, x1)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         return self.a.__ccall__(x) * (1 - self.which) + self.b.__ccall__(x) * self.which
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":3707
 *         return self.a.__ccall__(x) * (1 - self.which) + self.b.__ccall__(x) * self.which
 * 
 *     def __getstate__(self): return self.a, self.b, self.which             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfBlendConst_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_14_BpfBlendConst_2__getstate__[] = "_BpfBlendConst.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_14_BpfBlendConst_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfBlendConst_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_14_BpfBlendConst_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_14_BpfBlendConst_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfBlendConst_2__getstate__(((struct __pyx_obj_4bpf4_4core__BpfBlendConst *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfBlendConst_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfBlendConst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->which); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->a));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->a));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->b));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->b));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->b));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core._BpfBlendConst.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3721
 *     cdef InterpolFunc* last_interpol
 * 
 *     def __cinit__(self, xs, ys, interpolations):             # <<<<<<<<<<<<<<
 *         self.size = len(xs)
 *         self.interpolations = <InterpolFunc **>malloc(sizeof(InterpolFunc*) * (self.size - 1))
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_5Multi_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_5Multi_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  CYTHON_UNUSED PyObject *__pyx_v_ys = 0;
  CYTHON_UNUSED PyObject *__pyx_v_interpolations = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,&__pyx_n_s_interpolations,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 3721, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolations)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 3721, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 3721, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
    __pyx_v_interpolations = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3721, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Multi.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_5Multi___cinit__(((struct __pyx_obj_4bpf4_4core_Multi *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys, __pyx_v_interpolations);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_5Multi___cinit__(struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self, PyObject *__pyx_v_xs, CYTHON_UNUSED PyObject *__pyx_v_ys, CYTHON_UNUSED PyObject *__pyx_v_interpolations) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "bpf4/core.pyx":3722
 * 
 *     def __cinit__(self, xs, ys, interpolations):
 *         self.size = len(xs)             # <<<<<<<<<<<<<<
 *         self.interpolations = <InterpolFunc **>malloc(sizeof(InterpolFunc*) * (self.size - 1))
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_xs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3722, __pyx_L1_error)
  __pyx_v_self->size = __pyx_t_1;

  /* "bpf4/core.pyx":3723
 *     def __cinit__(self, xs, ys, interpolations):
 *         self.size = len(xs)
 *         self.interpolations = <InterpolFunc **>malloc(sizeof(InterpolFunc*) * (self.size - 1))             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, xs, ys, interpolations):
 */
  __pyx_v_self->interpolations = ((__pyx_t_4bpf4_4core_InterpolFunc **)malloc(((sizeof(__pyx_t_4bpf4_4core_InterpolFunc *)) * (__pyx_v_self->size - 1))));

  /* "bpf4/core.pyx":3721
 *     cdef InterpolFunc* last_interpol
 * 
 *     def __cinit__(self, xs, ys, interpolations):             # <<<<<<<<<<<<<<
 *         self.size = len(xs)
 *         self.interpolations = <InterpolFunc **>malloc(sizeof(InterpolFunc*) * (self.size - 1))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core.Multi.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3725
 *         self.interpolations = <InterpolFunc **>malloc(sizeof(InterpolFunc*) * (self.size - 1))
 * 
 *     def __init__(self, xs, ys, interpolations):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_5Multi_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_5Multi_2__init__[] = "\n        Args:\n            xs (ndarray): the sequence of x points\n            ys (ndarray): the sequence of y points\n            interpolations (list[str]): the interpolation used between these points\n\n        !!! note\n\n            ```python\n            \n            len(interpolations) == len(xs) - 1\n\n            ```\n\n        The interpelation is indicated via a descriptor: `'linear'` (linear), `'expon(x)'` \n        (exponential with exp=x), `'halfcos'`, `'halfcos(x)'` (cosine interpol with exp=x),\n        `'nointerpol'`, ``'smooth'` (smoothstep)\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_5Multi_2__init__;
#endif
static int __pyx_pw_4bpf4_4core_5Multi_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyObject *__pyx_v_ys = 0;
  PyObject *__pyx_v_interpolations = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_ys,&__pyx_n_s_interpolations,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ys)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 3725, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolations)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 3725, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3725, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_xs = values[0];
    __pyx_v_ys = values[1];
    __pyx_v_interpolations = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3725, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Multi.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_5Multi_2__init__(((struct __pyx_obj_4bpf4_4core_Multi *)__pyx_v_self), __pyx_v_xs, __pyx_v_ys, __pyx_v_interpolations);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_5Multi_2__init__(struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self, PyObject *__pyx_v_xs, PyObject *__pyx_v_ys, PyObject *__pyx_v_interpolations) {
  int __pyx_v_i;
  PyObject *__pyx_v_interpolation = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":3746
 *         cdef int i
 *         cdef list interpolations_list
 *         self.xs = _seq_to_doubles(xs)             # <<<<<<<<<<<<<<
 *         self.ys = _seq_to_doubles(ys)
 *         assert len(interpolations) == self.size - 1
 */
  __pyx_v_self->xs = __pyx_f_4bpf4_4core__seq_to_doubles(__pyx_v_xs);

  /* "bpf4/core.pyx":3747
 *         cdef list interpolations_list
 *         self.xs = _seq_to_doubles(xs)
 *         self.ys = _seq_to_doubles(ys)             # <<<<<<<<<<<<<<
 *         assert len(interpolations) == self.size - 1
 *         i = 0
 */
  __pyx_v_self->ys = __pyx_f_4bpf4_4core__seq_to_doubles(__pyx_v_ys);

  /* "bpf4/core.pyx":3748
 *         self.xs = _seq_to_doubles(xs)
 *         self.ys = _seq_to_doubles(ys)
 *         assert len(interpolations) == self.size - 1             # <<<<<<<<<<<<<<
 *         i = 0
 *         for interpolation in interpolations:
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = PyObject_Length(__pyx_v_interpolations); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3748, __pyx_L1_error)
    if (unlikely(!((__pyx_t_1 == (__pyx_v_self->size - 1)) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 3748, __pyx_L1_error)
    }
  }
  #endif

  /* "bpf4/core.pyx":3749
 *         self.ys = _seq_to_doubles(ys)
 *         assert len(interpolations) == self.size - 1
 *         i = 0             # <<<<<<<<<<<<<<
 *         for interpolation in interpolations:
 *             self.interpolations[i] = InterpolFunc_new_from_descriptor(interpolation)
 */
  __pyx_v_i = 0;

  /* "bpf4/core.pyx":3750
 *         assert len(interpolations) == self.size - 1
 *         i = 0
 *         for interpolation in interpolations:             # <<<<<<<<<<<<<<
 *             self.interpolations[i] = InterpolFunc_new_from_descriptor(interpolation)
 *             i += 1
 */
  if (likely(PyList_CheckExact(__pyx_v_interpolations)) || PyTuple_CheckExact(__pyx_v_interpolations)) {
    __pyx_t_2 = __pyx_v_interpolations; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_interpolations); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3750, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 3750, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3750, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 3750, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3750, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_2);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 3750, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_interpolation, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "bpf4/core.pyx":3751
 *         i = 0
 *         for interpolation in interpolations:
 *             self.interpolations[i] = InterpolFunc_new_from_descriptor(interpolation)             # <<<<<<<<<<<<<<
 *             i += 1
 *         self._set_bounds(self.xs[0], self.xs[self.size - 1])
 */
    if (!(likely(PyUnicode_CheckExact(__pyx_v_interpolation))||((__pyx_v_interpolation) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_interpolation)->tp_name), 0))) __PYX_ERR(0, 3751, __pyx_L1_error)
    (__pyx_v_self->interpolations[__pyx_v_i]) = __pyx_f_4bpf4_4core_InterpolFunc_new_from_descriptor(((PyObject*)__pyx_v_interpolation), NULL);

    /* "bpf4/core.pyx":3752
 *         for interpolation in interpolations:
 *             self.interpolations[i] = InterpolFunc_new_from_descriptor(interpolation)
 *             i += 1             # <<<<<<<<<<<<<<
 *         self._set_bounds(self.xs[0], self.xs[self.size - 1])
 *         self.y0 = self.ys[0]
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "bpf4/core.pyx":3750
 *         assert len(interpolations) == self.size - 1
 *         i = 0
 *         for interpolation in interpolations:             # <<<<<<<<<<<<<<
 *             self.interpolations[i] = InterpolFunc_new_from_descriptor(interpolation)
 *             i += 1
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bpf4/core.pyx":3753
 *             self.interpolations[i] = InterpolFunc_new_from_descriptor(interpolation)
 *             i += 1
 *         self._set_bounds(self.xs[0], self.xs[self.size - 1])             # <<<<<<<<<<<<<<
 *         self.y0 = self.ys[0]
 *         self.y1 = self.ys[self.size - 1]
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), (__pyx_v_self->xs[0]), (__pyx_v_self->xs[(__pyx_v_self->size - 1)]));

  /* "bpf4/core.pyx":3754
 *             i += 1
 *         self._set_bounds(self.xs[0], self.xs[self.size - 1])
 *         self.y0 = self.ys[0]             # <<<<<<<<<<<<<<
 *         self.y1 = self.ys[self.size - 1]
 *         self.last_x0 = self.xs[0]
 */
  __pyx_v_self->y0 = (__pyx_v_self->ys[0]);

  /* "bpf4/core.pyx":3755
 *         self._set_bounds(self.xs[0], self.xs[self.size - 1])
 *         self.y0 = self.ys[0]
 *         self.y1 = self.ys[self.size - 1]             # <<<<<<<<<<<<<<
 *         self.last_x0 = self.xs[0]
 *         self.last_x1 = self.xs[1]
 */
  __pyx_v_self->y1 = (__pyx_v_self->ys[(__pyx_v_self->size - 1)]);

  /* "bpf4/core.pyx":3756
 *         self.y0 = self.ys[0]
 *         self.y1 = self.ys[self.size - 1]
 *         self.last_x0 = self.xs[0]             # <<<<<<<<<<<<<<
 *         self.last_x1 = self.xs[1]
 *         self.last_y0 = self.ys[0]
 */
  __pyx_v_self->last_x0 = (__pyx_v_self->xs[0]);

  /* "bpf4/core.pyx":3757
 *         self.y1 = self.ys[self.size - 1]
 *         self.last_x0 = self.xs[0]
 *         self.last_x1 = self.xs[1]             # <<<<<<<<<<<<<<
 *         self.last_y0 = self.ys[0]
 *         self.last_y1 = self.ys[1]
 */
  __pyx_v_self->last_x1 = (__pyx_v_self->xs[1]);

  /* "bpf4/core.pyx":3758
 *         self.last_x0 = self.xs[0]
 *         self.last_x1 = self.xs[1]
 *         self.last_y0 = self.ys[0]             # <<<<<<<<<<<<<<
 *         self.last_y1 = self.ys[1]
 *         self.last_interpol = self.interpolations[0]
 */
  __pyx_v_self->last_y0 = (__pyx_v_self->ys[0]);

  /* "bpf4/core.pyx":3759
 *         self.last_x1 = self.xs[1]
 *         self.last_y0 = self.ys[0]
 *         self.last_y1 = self.ys[1]             # <<<<<<<<<<<<<<
 *         self.last_interpol = self.interpolations[0]
 * 
 */
  __pyx_v_self->last_y1 = (__pyx_v_self->ys[1]);

  /* "bpf4/core.pyx":3760
 *         self.last_y0 = self.ys[0]
 *         self.last_y1 = self.ys[1]
 *         self.last_interpol = self.interpolations[0]             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->last_interpol = (__pyx_v_self->interpolations[0]);

  /* "bpf4/core.pyx":3725
 *         self.interpolations = <InterpolFunc **>malloc(sizeof(InterpolFunc*) * (self.size - 1))
 * 
 *     def __init__(self, xs, ys, interpolations):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core.Multi.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_interpolation);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3762
 *         self.last_interpol = self.interpolations[0]
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.xs)
 *         free(self.ys)
 */

/* Python wrapper */
static void __pyx_pw_4bpf4_4core_5Multi_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_4bpf4_4core_5Multi_5__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_4bpf4_4core_5Multi_4__dealloc__(((struct __pyx_obj_4bpf4_4core_Multi *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_4bpf4_4core_5Multi_4__dealloc__(struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self) {
  int __pyx_v_i;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "bpf4/core.pyx":3763
 * 
 *     def __dealloc__(self):
 *         free(self.xs)             # <<<<<<<<<<<<<<
 *         free(self.ys)
 *         cdef int i
 */
  free(__pyx_v_self->xs);

  /* "bpf4/core.pyx":3764
 *     def __dealloc__(self):
 *         free(self.xs)
 *         free(self.ys)             # <<<<<<<<<<<<<<
 *         cdef int i
 *         for i in range(self.size - 1):
 */
  free(__pyx_v_self->ys);

  /* "bpf4/core.pyx":3766
 *         free(self.ys)
 *         cdef int i
 *         for i in range(self.size - 1):             # <<<<<<<<<<<<<<
 *             InterpolFunc_free(self.interpolations[i])
 *         free(self.interpolations)
 */
  __pyx_t_1 = (__pyx_v_self->size - 1);
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":3767
 *         cdef int i
 *         for i in range(self.size - 1):
 *             InterpolFunc_free(self.interpolations[i])             # <<<<<<<<<<<<<<
 *         free(self.interpolations)
 * 
 */
    __pyx_f_4bpf4_4core_InterpolFunc_free((__pyx_v_self->interpolations[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":3768
 *         for i in range(self.size - 1):
 *             InterpolFunc_free(self.interpolations[i])
 *         free(self.interpolations)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  free(__pyx_v_self->interpolations);

  /* "bpf4/core.pyx":3762
 *         self.last_interpol = self.interpolations[0]
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.xs)
 *         free(self.ys)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":3770
 *         free(self.interpolations)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         xs = [self.xs[i] for i in range(self.size)]
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Multi_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_5Multi_6__getstate__[] = "Multi.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_5Multi_7__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_5Multi_7__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_5Multi_6__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_5Multi_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Multi_6__getstate__(((struct __pyx_obj_4bpf4_4core_Multi *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Multi_6__getstate__(struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self) {
  PyObject *__pyx_v_xs = NULL;
  PyObject *__pyx_v_ys = NULL;
  PyObject *__pyx_v_interpolations = NULL;
  int __pyx_8genexpr4__pyx_v_i;
  int __pyx_8genexpr5__pyx_v_i;
  int __pyx_8genexpr6__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  long __pyx_t_6;
  long __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":3772
 *     def __getstate__(self):
 *         cdef int i
 *         xs = [self.xs[i] for i in range(self.size)]             # <<<<<<<<<<<<<<
 *         ys = [self.ys[i] for i in range(self.size)]
 *         interpolations = [InterpolFunc_get_descriptor(self.interpolations[i]) for i in range(self.size - 1)]
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_self->size;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_8genexpr4__pyx_v_i = __pyx_t_4;
      __pyx_t_5 = PyFloat_FromDouble((__pyx_v_self->xs[__pyx_8genexpr4__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3772, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 3772, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_v_xs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3773
 *         cdef int i
 *         xs = [self.xs[i] for i in range(self.size)]
 *         ys = [self.ys[i] for i in range(self.size)]             # <<<<<<<<<<<<<<
 *         interpolations = [InterpolFunc_get_descriptor(self.interpolations[i]) for i in range(self.size - 1)]
 *         return xs, ys, interpolations
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_self->size;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_8genexpr5__pyx_v_i = __pyx_t_4;
      __pyx_t_5 = PyFloat_FromDouble((__pyx_v_self->ys[__pyx_8genexpr5__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3773, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 3773, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_v_ys = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3774
 *         xs = [self.xs[i] for i in range(self.size)]
 *         ys = [self.ys[i] for i in range(self.size)]
 *         interpolations = [InterpolFunc_get_descriptor(self.interpolations[i]) for i in range(self.size - 1)]             # <<<<<<<<<<<<<<
 *         return xs, ys, interpolations
 * 
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__pyx_v_self->size - 1);
    __pyx_t_7 = __pyx_t_6;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_7; __pyx_t_2+=1) {
      __pyx_8genexpr6__pyx_v_i = __pyx_t_2;
      __pyx_t_5 = __pyx_f_4bpf4_4core_InterpolFunc_get_descriptor((__pyx_v_self->interpolations[__pyx_8genexpr6__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3774, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 3774, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_v_interpolations = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3775
 *         ys = [self.ys[i] for i in range(self.size)]
 *         interpolations = [InterpolFunc_get_descriptor(self.interpolations[i]) for i in range(self.size - 1)]
 *         return xs, ys, interpolations             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_xs);
  __Pyx_GIVEREF(__pyx_v_xs);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xs);
  __Pyx_INCREF(__pyx_v_ys);
  __Pyx_GIVEREF(__pyx_v_ys);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ys);
  __Pyx_INCREF(__pyx_v_interpolations);
  __Pyx_GIVEREF(__pyx_v_interpolations);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_interpolations);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3770
 *         free(self.interpolations)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         xs = [self.xs[i] for i in range(self.size)]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.Multi.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xs);
  __Pyx_XDECREF(__pyx_v_ys);
  __Pyx_XDECREF(__pyx_v_interpolations);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3777
 *         return xs, ys, interpolations
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double res, x0, x1, y0, y1
 *         cdef int index1, index0
 */

static double __pyx_f_4bpf4_4core_5Multi___ccall__(struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_res;
  double __pyx_v_x0;
  double __pyx_v_x1;
  double __pyx_v_y0;
  double __pyx_v_y1;
  int __pyx_v_index1;
  int __pyx_v_index0;
  double __pyx_r;
  int __pyx_t_1;
  __pyx_t_4bpf4_4core_DTYPE_t __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":3780
 *         cdef double res, x0, x1, y0, y1
 *         cdef int index1, index0
 *         if x <= self._x0:             # <<<<<<<<<<<<<<
 *             res = self.y0
 *         elif x >= self._x1:
 */
  __pyx_t_1 = ((__pyx_v_x <= __pyx_v_self->__pyx_base._x0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":3781
 *         cdef int index1, index0
 *         if x <= self._x0:
 *             res = self.y0             # <<<<<<<<<<<<<<
 *         elif x >= self._x1:
 *             res = self.y1
 */
    __pyx_t_2 = __pyx_v_self->y0;
    __pyx_v_res = __pyx_t_2;

    /* "bpf4/core.pyx":3780
 *         cdef double res, x0, x1, y0, y1
 *         cdef int index1, index0
 *         if x <= self._x0:             # <<<<<<<<<<<<<<
 *             res = self.y0
 *         elif x >= self._x1:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":3782
 *         if x <= self._x0:
 *             res = self.y0
 *         elif x >= self._x1:             # <<<<<<<<<<<<<<
 *             res = self.y1
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_x >= __pyx_v_self->__pyx_base._x1) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":3783
 *             res = self.y0
 *         elif x >= self._x1:
 *             res = self.y1             # <<<<<<<<<<<<<<
 *         else:
 *             if self.last_x0 <= x < self.last_x1:
 */
    __pyx_t_2 = __pyx_v_self->y1;
    __pyx_v_res = __pyx_t_2;

    /* "bpf4/core.pyx":3782
 *         if x <= self._x0:
 *             res = self.y0
 *         elif x >= self._x1:             # <<<<<<<<<<<<<<
 *             res = self.y1
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":3785
 *             res = self.y1
 *         else:
 *             if self.last_x0 <= x < self.last_x1:             # <<<<<<<<<<<<<<
 *                 # res = self.last_interpol.func(x, self.last_x0, self.last_y0, self.last_x1, self.last_y1, self.last_interpol.exp)
 *                 res = InterpolFunc_call(self.last_interpol, x, self.last_x0, self.last_y0, self.last_x1, self.last_y1)
 */
  /*else*/ {
    __pyx_t_1 = (__pyx_v_self->last_x0 <= __pyx_v_x);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_x < __pyx_v_self->last_x1);
    }
    __pyx_t_3 = (__pyx_t_1 != 0);
    if (__pyx_t_3) {

      /* "bpf4/core.pyx":3787
 *             if self.last_x0 <= x < self.last_x1:
 *                 # res = self.last_interpol.func(x, self.last_x0, self.last_y0, self.last_x1, self.last_y1, self.last_interpol.exp)
 *                 res = InterpolFunc_call(self.last_interpol, x, self.last_x0, self.last_y0, self.last_x1, self.last_y1)             # <<<<<<<<<<<<<<
 *             else:
 *                 index1 = _csearchsorted(self.xs, self.size, x)
 */
      __pyx_v_res = __pyx_f_4bpf4_4core_InterpolFunc_call(__pyx_v_self->last_interpol, __pyx_v_x, __pyx_v_self->last_x0, __pyx_v_self->last_y0, __pyx_v_self->last_x1, __pyx_v_self->last_y1);

      /* "bpf4/core.pyx":3785
 *             res = self.y1
 *         else:
 *             if self.last_x0 <= x < self.last_x1:             # <<<<<<<<<<<<<<
 *                 # res = self.last_interpol.func(x, self.last_x0, self.last_y0, self.last_x1, self.last_y1, self.last_interpol.exp)
 *                 res = InterpolFunc_call(self.last_interpol, x, self.last_x0, self.last_y0, self.last_x1, self.last_y1)
 */
      goto __pyx_L4;
    }

    /* "bpf4/core.pyx":3789
 *                 res = InterpolFunc_call(self.last_interpol, x, self.last_x0, self.last_y0, self.last_x1, self.last_y1)
 *             else:
 *                 index1 = _csearchsorted(self.xs, self.size, x)             # <<<<<<<<<<<<<<
 *                 index0 = index1 - 1
 *                 self.last_x0 = x0 = self.xs[index0]
 */
    /*else*/ {
      __pyx_v_index1 = __pyx_f_4bpf4_4core__csearchsorted(__pyx_v_self->xs, __pyx_v_self->size, __pyx_v_x);

      /* "bpf4/core.pyx":3790
 *             else:
 *                 index1 = _csearchsorted(self.xs, self.size, x)
 *                 index0 = index1 - 1             # <<<<<<<<<<<<<<
 *                 self.last_x0 = x0 = self.xs[index0]
 *                 self.last_x1 = x1 = self.xs[index1]
 */
      __pyx_v_index0 = (__pyx_v_index1 - 1);

      /* "bpf4/core.pyx":3791
 *                 index1 = _csearchsorted(self.xs, self.size, x)
 *                 index0 = index1 - 1
 *                 self.last_x0 = x0 = self.xs[index0]             # <<<<<<<<<<<<<<
 *                 self.last_x1 = x1 = self.xs[index1]
 *                 self.last_y0 = y0 = self.ys[index0]
 */
      __pyx_v_self->last_x0 = (__pyx_v_self->xs[__pyx_v_index0]);
      __pyx_v_x0 = (__pyx_v_self->xs[__pyx_v_index0]);

      /* "bpf4/core.pyx":3792
 *                 index0 = index1 - 1
 *                 self.last_x0 = x0 = self.xs[index0]
 *                 self.last_x1 = x1 = self.xs[index1]             # <<<<<<<<<<<<<<
 *                 self.last_y0 = y0 = self.ys[index0]
 *                 self.last_y1 = y1 = self.ys[index1]
 */
      __pyx_v_self->last_x1 = (__pyx_v_self->xs[__pyx_v_index1]);
      __pyx_v_x1 = (__pyx_v_self->xs[__pyx_v_index1]);

      /* "bpf4/core.pyx":3793
 *                 self.last_x0 = x0 = self.xs[index0]
 *                 self.last_x1 = x1 = self.xs[index1]
 *                 self.last_y0 = y0 = self.ys[index0]             # <<<<<<<<<<<<<<
 *                 self.last_y1 = y1 = self.ys[index1]
 *                 self.last_interpol = self.interpolations[index0]
 */
      __pyx_v_self->last_y0 = (__pyx_v_self->ys[__pyx_v_index0]);
      __pyx_v_y0 = (__pyx_v_self->ys[__pyx_v_index0]);

      /* "bpf4/core.pyx":3794
 *                 self.last_x1 = x1 = self.xs[index1]
 *                 self.last_y0 = y0 = self.ys[index0]
 *                 self.last_y1 = y1 = self.ys[index1]             # <<<<<<<<<<<<<<
 *                 self.last_interpol = self.interpolations[index0]
 *                 # res = self.last_interpol.func(x, x0, y0, x1, y1, self.last_interpol.exp)
 */
      __pyx_v_self->last_y1 = (__pyx_v_self->ys[__pyx_v_index1]);
      __pyx_v_y1 = (__pyx_v_self->ys[__pyx_v_index1]);

      /* "bpf4/core.pyx":3795
 *                 self.last_y0 = y0 = self.ys[index0]
 *                 self.last_y1 = y1 = self.ys[index1]
 *                 self.last_interpol = self.interpolations[index0]             # <<<<<<<<<<<<<<
 *                 # res = self.last_interpol.func(x, x0, y0, x1, y1, self.last_interpol.exp)
 *                 res = InterpolFunc_call(self.last_interpol, x, x0, y0, x1, y1)
 */
      __pyx_v_self->last_interpol = (__pyx_v_self->interpolations[__pyx_v_index0]);

      /* "bpf4/core.pyx":3797
 *                 self.last_interpol = self.interpolations[index0]
 *                 # res = self.last_interpol.func(x, x0, y0, x1, y1, self.last_interpol.exp)
 *                 res = InterpolFunc_call(self.last_interpol, x, x0, y0, x1, y1)             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
      __pyx_v_res = __pyx_f_4bpf4_4core_InterpolFunc_call(__pyx_v_self->last_interpol, __pyx_v_x, __pyx_v_x0, __pyx_v_y0, __pyx_v_x1, __pyx_v_y1);
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":3798
 *                 # res = self.last_interpol.func(x, x0, y0, x1, y1, self.last_interpol.exp)
 *                 res = InterpolFunc_call(self.last_interpol, x, x0, y0, x1, y1)
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     def segments(self):
 */
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3777
 *         return xs, ys, interpolations
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double res, x0, x1, y0, y1
 *         cdef int index1, index0
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}
static PyObject *__pyx_gb_4bpf4_4core_5Multi_10generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "bpf4/core.pyx":3800
 *         return res
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Multi_9segments(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_5Multi_8segments[] = "Multi.segments(self)\n\n        Returns an iterator over the segments of this bpf\n\n        Returns:\n            (Iterator[tuple[float, float, str, float]]) An iterator of segments, \n            where each segment has the form `(x, y, interpoltype:str, exponent)`\n\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_5Multi_9segments = {"segments", (PyCFunction)__pyx_pw_4bpf4_4core_5Multi_9segments, METH_NOARGS, __pyx_doc_4bpf4_4core_5Multi_8segments};
static PyObject *__pyx_pw_4bpf4_4core_5Multi_9segments(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segments (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Multi_8segments(((struct __pyx_obj_4bpf4_4core_Multi *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Multi_8segments(struct __pyx_obj_4bpf4_4core_Multi *__pyx_v_self) {
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("segments", 0);
  __pyx_cur_scope = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments *)__pyx_tp_new_4bpf4_4core___pyx_scope_struct_4_segments(__pyx_ptype_4bpf4_4core___pyx_scope_struct_4_segments, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3800, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4bpf4_4core_5Multi_10generator4, __pyx_codeobj__33, (PyObject *) __pyx_cur_scope, __pyx_n_s_segments, __pyx_n_s_Multi_segments, __pyx_n_s_bpf4_core); if (unlikely(!gen)) __PYX_ERR(0, 3800, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core.Multi.segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_4bpf4_4core_5Multi_10generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments *__pyx_cur_scope = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("segments", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    case 2: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3800, __pyx_L1_error)

  /* "bpf4/core.pyx":3811
 *         cdef int i
 *         cdef InterpolFunc* func
 *         for i in range(self.size - 1):             # <<<<<<<<<<<<<<
 *             func = self.interpolations[i]
 *             yield self.xs[i], self.ys[i], func.name, func.exp
 */
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->size - 1);
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":3812
 *         cdef InterpolFunc* func
 *         for i in range(self.size - 1):
 *             func = self.interpolations[i]             # <<<<<<<<<<<<<<
 *             yield self.xs[i], self.ys[i], func.name, func.exp
 *         yield (self.xs[self.size-1], self.ys[self.size-1], '', 0)
 */
    __pyx_cur_scope->__pyx_v_func = (__pyx_cur_scope->__pyx_v_self->interpolations[__pyx_cur_scope->__pyx_v_i]);

    /* "bpf4/core.pyx":3813
 *         for i in range(self.size - 1):
 *             func = self.interpolations[i]
 *             yield self.xs[i], self.ys[i], func.name, func.exp             # <<<<<<<<<<<<<<
 *         yield (self.xs[self.size-1], self.ys[self.size-1], '', 0)
 * 
 */
    __pyx_t_4 = PyFloat_FromDouble((__pyx_cur_scope->__pyx_v_self->xs[__pyx_cur_scope->__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyFloat_FromDouble((__pyx_cur_scope->__pyx_v_self->ys[__pyx_cur_scope->__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyStr_FromString(__pyx_cur_scope->__pyx_v_func->name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_func->exp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3813, __pyx_L1_error)
  }

  /* "bpf4/core.pyx":3814
 *             func = self.interpolations[i]
 *             yield self.xs[i], self.ys[i], func.name, func.exp
 *         yield (self.xs[self.size-1], self.ys[self.size-1], '', 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_8 = PyFloat_FromDouble((__pyx_cur_scope->__pyx_v_self->xs[(__pyx_cur_scope->__pyx_v_self->size - 1)])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyFloat_FromDouble((__pyx_cur_scope->__pyx_v_self->ys[(__pyx_cur_scope->__pyx_v_self->size - 1)])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
  __Pyx_INCREF(__pyx_kp_u__6);
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__6);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_int_0);
  __pyx_t_8 = 0;
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  /* return from generator, yielding value */
  __pyx_generator->resume_label = 2;
  return __pyx_r;
  __pyx_L7_resume_from_yield:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3814, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "bpf4/core.pyx":3800
 *         return res
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3820
 * 
 * 
 * def _FunctionWrap(f, bounds=(INFNEG, INF)):             # <<<<<<<<<<<<<<
 *     return _FunctionWrap_Object(f, bounds)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_7_FunctionWrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_6_FunctionWrap[] = "_FunctionWrap(f, bounds=(-inf, inf))";
static PyMethodDef __pyx_mdef_4bpf4_4core_7_FunctionWrap = {"_FunctionWrap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7_FunctionWrap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_6_FunctionWrap};
static PyObject *__pyx_pw_4bpf4_4core_7_FunctionWrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_v_bounds = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_FunctionWrap (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_bounds,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_tuple__5));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bounds);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_FunctionWrap") < 0)) __PYX_ERR(0, 3820, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_f = values[0];
    __pyx_v_bounds = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_FunctionWrap", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3820, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._FunctionWrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_6_FunctionWrap(__pyx_self, __pyx_v_f, __pyx_v_bounds);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_6_FunctionWrap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f, PyObject *__pyx_v_bounds) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_FunctionWrap", 0);

  /* "bpf4/core.pyx":3821
 * 
 * def _FunctionWrap(f, bounds=(INFNEG, INF)):
 *     return _FunctionWrap_Object(f, bounds)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_f);
  __Pyx_GIVEREF(__pyx_v_f);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_f);
  __Pyx_INCREF(__pyx_v_bounds);
  __Pyx_GIVEREF(__pyx_v_bounds);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_bounds);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__FunctionWrap_Object), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3820
 * 
 * 
 * def _FunctionWrap(f, bounds=(INFNEG, INF)):             # <<<<<<<<<<<<<<
 *     return _FunctionWrap_Object(f, bounds)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core._FunctionWrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3827
 *     cdef object f
 * 
 *     def __init__(self, f, bounds=(INFNEG, INF)):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_20_FunctionWrap_Object_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_20_FunctionWrap_Object___init__[] = "\n        Args:\n            f (callable): a function to wrap as a bpf\n            bounds (tuple[float, float]): the bounds of this bpf\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_20_FunctionWrap_Object___init__;
#endif
static int __pyx_pw_4bpf4_4core_20_FunctionWrap_Object_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_v_bounds = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_bounds,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_tuple__5);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bounds);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3827, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_f = values[0];
    __pyx_v_bounds = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3827, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_20_FunctionWrap_Object___init__(((struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *)__pyx_v_self), __pyx_v_f, __pyx_v_bounds);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_20_FunctionWrap_Object___init__(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_bounds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  double __pyx_t_2;
  double __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":3833
 *             bounds (tuple[float, float]): the bounds of this bpf
 *         """
 *         self._set_bounds(bounds[0], bounds[1])             # <<<<<<<<<<<<<<
 *         self.f = f.__call__
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_t_2, __pyx_t_3);

  /* "bpf4/core.pyx":3834
 *         """
 *         self._set_bounds(bounds[0], bounds[1])
 *         self.f = f.__call__             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_call); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->f);
  __Pyx_DECREF(__pyx_v_self->f);
  __pyx_v_self->f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3827
 *     cdef object f
 * 
 *     def __init__(self, f, bounds=(INFNEG, INF)):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3836
 *         self.f = f.__call__
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         with gil:
 *             return self.f(x)
 */

static double __pyx_f_4bpf4_4core_20_FunctionWrap_Object___ccall__(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, double __pyx_v_x) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("__ccall__", 0);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif

  /* "bpf4/core.pyx":3837
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         with gil:             # <<<<<<<<<<<<<<
 *             return self.f(x)
 * 
 */
  /*try:*/ {
    {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
        #endif
        /*try:*/ {

          /* "bpf4/core.pyx":3838
 *     cdef double __ccall__(self, double x) nogil:
 *         with gil:
 *             return self.f(x)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
          __pyx_t_2 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3838, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_self->f);
          __pyx_t_3 = __pyx_v_self->f; __pyx_t_4 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3838, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3838, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_r = __pyx_t_5;
          goto __pyx_L6_return;
        }

        /* "bpf4/core.pyx":3837
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         with gil:             # <<<<<<<<<<<<<<
 *             return self.f(x)
 * 
 */
        /*finally:*/ {
          __pyx_L6_return: {
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            goto __pyx_L3_return;
          }
          __pyx_L7_error: {
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            goto __pyx_L4_error;
          }
        }
    }
  }
  /*finally:*/ {
    __pyx_L3_return: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L0;
    }
    __pyx_L4_error: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L1_error;
    }
  }

  /* "bpf4/core.pyx":3836
 *         self.f = f.__call__
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         with gil:
 *             return self.f(x)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("bpf4.core._FunctionWrap_Object.__ccall__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
  __pyx_r = 0;
  __pyx_L0:;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "bpf4/core.pyx":3840
 *             return self.f(x)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.f, (self._x0, self._x1))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_20_FunctionWrap_Object_2__getstate__[] = "_FunctionWrap_Object.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_20_FunctionWrap_Object_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_20_FunctionWrap_Object_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_20_FunctionWrap_Object_2__getstate__(((struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_20_FunctionWrap_Object_2__getstate__(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":3841
 * 
 *     def __getstate__(self):
 *         return (self.f, (self._x0, self._x1))             # <<<<<<<<<<<<<<
 * 
 *     cpdef BpfInterface _slice(self, double x0, double x1):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._x0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->f);
  __Pyx_GIVEREF(__pyx_v_self->f);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->f);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3840
 *             return self.f(x)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.f, (self._x0, self._x1))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3843
 *         return (self.f, (self._x0, self._x1))
 * 
 *     cpdef BpfInterface _slice(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         return _FunctionWrap_Object_OutboundConst_new(self, x0, x1)
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_5_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_20_FunctionWrap_Object__slice(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_slice", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_slice); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3843, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_5_slice)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3843, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3843, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3843, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3843, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3843, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3843, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 3843, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3844
 * 
 *     cpdef BpfInterface _slice(self, double x0, double x1):
 *         return _FunctionWrap_Object_OutboundConst_new(self, x0, x1)             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__FunctionWrap_Object_OutboundConst_new(__pyx_v_self, __pyx_v_x0, __pyx_v_x1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3843
 *         return (self.f, (self._x0, self._x1))
 * 
 *     cpdef BpfInterface _slice(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         return _FunctionWrap_Object_OutboundConst_new(self, x0, x1)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object._slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_5_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_20_FunctionWrap_Object_4_slice[] = "_FunctionWrap_Object._slice(self, double x0, double x1) -> BpfInterface";
static PyMethodDef __pyx_mdef_4bpf4_4core_20_FunctionWrap_Object_5_slice = {"_slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_5_slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_20_FunctionWrap_Object_4_slice};
static PyObject *__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_5_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_slice (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_slice", 1, 2, 2, 1); __PYX_ERR(0, 3843, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_slice") < 0)) __PYX_ERR(0, 3843, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3843, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3843, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_slice", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3843, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object._slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_20_FunctionWrap_Object_4_slice(((struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_20_FunctionWrap_Object_4_slice(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_slice", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_20_FunctionWrap_Object__slice(__pyx_v_self, __pyx_v_x0, __pyx_v_x1, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object._slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3846
 *         return _FunctionWrap_Object_OutboundConst_new(self, x0, x1)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */

static PyObject *__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_7map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_20_FunctionWrap_Object_map(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_20_FunctionWrap_Object_map *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  PyArrayObject *__pyx_v__xs = 0;
  PyArrayObject *__pyx_v_result = 0;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_data1;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_data0;
  PyObject *__pyx_v_xs_as_tuple = 0;
  int __pyx_v_i;
  int __pyx_v_nx;
  PyObject *__pyx_v_f = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd__xs;
  __Pyx_Buffer __pyx_pybuffer__xs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_t_16;
  __pyx_t_4bpf4_4core_DTYPE_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  npy_intp __pyx_t_19;
  npy_intp __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  __pyx_pybuffer__xs.pybuffer.buf = NULL;
  __pyx_pybuffer__xs.refcount = 0;
  __pyx_pybuffernd__xs.data = NULL;
  __pyx_pybuffernd__xs.rcbuffer = &__pyx_pybuffer__xs;
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3846, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_7map)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3846, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3846, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3846, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(__pyx_v_xs);
          __Pyx_GIVEREF(__pyx_v_xs);
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_xs);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_out));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3846, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3846, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3866
 *         cdef int i, nx
 *         cdef double x0,x1, dx
 *         cdef object f = self.f             # <<<<<<<<<<<<<<
 *         if isinstance(xs, (int, long)):
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 */
  __pyx_t_1 = __pyx_v_self->f;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_f = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3867
 *         cdef double x0,x1, dx
 *         cdef object f = self.f
 *         if isinstance(xs, (int, long)):             # <<<<<<<<<<<<<<
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         else:
 */
  __pyx_t_8 = PyInt_Check(__pyx_v_xs); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (!__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = PyLong_Check(__pyx_v_xs); 
  __pyx_t_8 = (__pyx_t_9 != 0);
  __pyx_t_7 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "bpf4/core.pyx":3868
 *         cdef object f = self.f
 *         if isinstance(xs, (int, long)):
 *             return self.mapn_between(xs, self._x0, self._x1, out)             # <<<<<<<<<<<<<<
 *         else:
 *             if out is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_xs); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3868, __pyx_L1_error)
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.out = __pyx_v_out;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core__FunctionWrap_Object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_t_5, __pyx_v_self->__pyx_base._x0, __pyx_v_self->__pyx_base._x1, 0, &__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3867
 *         cdef double x0,x1, dx
 *         cdef object f = self.f
 *         if isinstance(xs, (int, long)):             # <<<<<<<<<<<<<<
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         else:
 */
  }

  /* "bpf4/core.pyx":3870
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         else:
 *             if out is None:             # <<<<<<<<<<<<<<
 *                 nx = len(xs)
 *                 result = EMPTY1D(nx)
 */
  /*else*/ {
    __pyx_t_8 = (((PyObject *)__pyx_v_out) == Py_None);
    __pyx_t_7 = (__pyx_t_8 != 0);
    if (__pyx_t_7) {

      /* "bpf4/core.pyx":3871
 *         else:
 *             if out is None:
 *                 nx = len(xs)             # <<<<<<<<<<<<<<
 *                 result = EMPTY1D(nx)
 *             else:
 */
      __pyx_t_11 = PyObject_Length(__pyx_v_xs); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3871, __pyx_L1_error)
      __pyx_v_nx = __pyx_t_11;

      /* "bpf4/core.pyx":3872
 *             if out is None:
 *                 nx = len(xs)
 *                 result = EMPTY1D(nx)             # <<<<<<<<<<<<<<
 *             else:
 *                 result = <ndarray>out
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_nx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
        __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_5 < 0)) {
          PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          }
          __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0;
        }
        __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3872, __pyx_L1_error)
      }
      __pyx_v_result = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "bpf4/core.pyx":3870
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         else:
 *             if out is None:             # <<<<<<<<<<<<<<
 *                 nx = len(xs)
 *                 result = EMPTY1D(nx)
 */
      goto __pyx_L6;
    }

    /* "bpf4/core.pyx":3874
 *                 result = EMPTY1D(nx)
 *             else:
 *                 result = <ndarray>out             # <<<<<<<<<<<<<<
 *                 nx = PyArray_DIM(<ndarray>result, 0)
 *             if isinstance(xs, ndarray):
 */
    /*else*/ {
      __pyx_t_1 = ((PyObject *)__pyx_v_out);
      __Pyx_INCREF(__pyx_t_1);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
        __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_5 < 0)) {
          PyErr_Fetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_14, __pyx_t_13, __pyx_t_12);
          }
          __pyx_t_14 = __pyx_t_13 = __pyx_t_12 = 0;
        }
        __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
        if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3874, __pyx_L1_error)
      }
      __pyx_v_result = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "bpf4/core.pyx":3875
 *             else:
 *                 result = <ndarray>out
 *                 nx = PyArray_DIM(<ndarray>result, 0)             # <<<<<<<<<<<<<<
 *             if isinstance(xs, ndarray):
 *                 if PyArray_ISCONTIGUOUS(<ndarray>xs):
 */
      __pyx_v_nx = PyArray_DIM(((PyArrayObject *)__pyx_v_result), 0);
    }
    __pyx_L6:;

    /* "bpf4/core.pyx":3876
 *                 result = <ndarray>out
 *                 nx = PyArray_DIM(<ndarray>result, 0)
 *             if isinstance(xs, ndarray):             # <<<<<<<<<<<<<<
 *                 if PyArray_ISCONTIGUOUS(<ndarray>xs):
 *                     data1 = <DTYPE_t *>((<ndarray>xs).data)
 */
    __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_xs, __pyx_ptype_5numpy_ndarray); 
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {

      /* "bpf4/core.pyx":3877
 *                 nx = PyArray_DIM(<ndarray>result, 0)
 *             if isinstance(xs, ndarray):
 *                 if PyArray_ISCONTIGUOUS(<ndarray>xs):             # <<<<<<<<<<<<<<
 *                     data1 = <DTYPE_t *>((<ndarray>xs).data)
 *                     if PyArray_ISCONTIGUOUS(result):
 */
      __pyx_t_8 = (PyArray_ISCONTIGUOUS(((PyArrayObject *)__pyx_v_xs)) != 0);
      if (__pyx_t_8) {

        /* "bpf4/core.pyx":3878
 *             if isinstance(xs, ndarray):
 *                 if PyArray_ISCONTIGUOUS(<ndarray>xs):
 *                     data1 = <DTYPE_t *>((<ndarray>xs).data)             # <<<<<<<<<<<<<<
 *                     if PyArray_ISCONTIGUOUS(result):
 *                         data0 = <DTYPE_t *>result.data
 */
        __pyx_v_data1 = ((__pyx_t_4bpf4_4core_DTYPE_t *)((PyArrayObject *)__pyx_v_xs)->data);

        /* "bpf4/core.pyx":3879
 *                 if PyArray_ISCONTIGUOUS(<ndarray>xs):
 *                     data1 = <DTYPE_t *>((<ndarray>xs).data)
 *                     if PyArray_ISCONTIGUOUS(result):             # <<<<<<<<<<<<<<
 *                         data0 = <DTYPE_t *>result.data
 *                         for i in range(nx):
 */
        __pyx_t_8 = (PyArray_ISCONTIGUOUS(((PyArrayObject *)__pyx_v_result)) != 0);
        if (__pyx_t_8) {

          /* "bpf4/core.pyx":3880
 *                     data1 = <DTYPE_t *>((<ndarray>xs).data)
 *                     if PyArray_ISCONTIGUOUS(result):
 *                         data0 = <DTYPE_t *>result.data             # <<<<<<<<<<<<<<
 *                         for i in range(nx):
 *                             data0[i] = f(data1[i])
 */
          __pyx_v_data0 = ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_result->data);

          /* "bpf4/core.pyx":3881
 *                     if PyArray_ISCONTIGUOUS(result):
 *                         data0 = <DTYPE_t *>result.data
 *                         for i in range(nx):             # <<<<<<<<<<<<<<
 *                             data0[i] = f(data1[i])
 *                     else:
 */
          __pyx_t_5 = __pyx_v_nx;
          __pyx_t_15 = __pyx_t_5;
          for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
            __pyx_v_i = __pyx_t_16;

            /* "bpf4/core.pyx":3882
 *                         data0 = <DTYPE_t *>result.data
 *                         for i in range(nx):
 *                             data0[i] = f(data1[i])             # <<<<<<<<<<<<<<
 *                     else:
 *                         nx = PyArray_DIM(<ndarray>xs, 0)
 */
            __pyx_t_2 = PyFloat_FromDouble((__pyx_v_data1[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3882, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_v_f);
            __pyx_t_3 = __pyx_v_f; __pyx_t_6 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_6)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_6);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3882, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3882, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            (__pyx_v_data0[__pyx_v_i]) = __pyx_t_17;
          }

          /* "bpf4/core.pyx":3879
 *                 if PyArray_ISCONTIGUOUS(<ndarray>xs):
 *                     data1 = <DTYPE_t *>((<ndarray>xs).data)
 *                     if PyArray_ISCONTIGUOUS(result):             # <<<<<<<<<<<<<<
 *                         data0 = <DTYPE_t *>result.data
 *                         for i in range(nx):
 */
          goto __pyx_L9;
        }

        /* "bpf4/core.pyx":3884
 *                             data0[i] = f(data1[i])
 *                     else:
 *                         nx = PyArray_DIM(<ndarray>xs, 0)             # <<<<<<<<<<<<<<
 *                         for i in range(nx):
 *                             result[i] = f(data1[i])
 */
        /*else*/ {
          __pyx_v_nx = PyArray_DIM(((PyArrayObject *)__pyx_v_xs), 0);

          /* "bpf4/core.pyx":3885
 *                     else:
 *                         nx = PyArray_DIM(<ndarray>xs, 0)
 *                         for i in range(nx):             # <<<<<<<<<<<<<<
 *                             result[i] = f(data1[i])
 *                 else:
 */
          __pyx_t_5 = __pyx_v_nx;
          __pyx_t_15 = __pyx_t_5;
          for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
            __pyx_v_i = __pyx_t_16;

            /* "bpf4/core.pyx":3886
 *                         nx = PyArray_DIM(<ndarray>xs, 0)
 *                         for i in range(nx):
 *                             result[i] = f(data1[i])             # <<<<<<<<<<<<<<
 *                 else:
 *                     _xs = <ndarray>xs
 */
            __pyx_t_3 = PyFloat_FromDouble((__pyx_v_data1[__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3886, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_v_f);
            __pyx_t_2 = __pyx_v_f; __pyx_t_6 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_6)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_6);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
              }
            }
            __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3886, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3886, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_18 = __pyx_v_i;
            *__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_17;
          }
        }
        __pyx_L9:;

        /* "bpf4/core.pyx":3877
 *                 nx = PyArray_DIM(<ndarray>result, 0)
 *             if isinstance(xs, ndarray):
 *                 if PyArray_ISCONTIGUOUS(<ndarray>xs):             # <<<<<<<<<<<<<<
 *                     data1 = <DTYPE_t *>((<ndarray>xs).data)
 *                     if PyArray_ISCONTIGUOUS(result):
 */
        goto __pyx_L8;
      }

      /* "bpf4/core.pyx":3888
 *                             result[i] = f(data1[i])
 *                 else:
 *                     _xs = <ndarray>xs             # <<<<<<<<<<<<<<
 *                     for i in range(PyArray_DIM(xs, 0)):
 *                         result[i] = f(_xs[i])
 */
      /*else*/ {
        __pyx_t_1 = __pyx_v_xs;
        __Pyx_INCREF(__pyx_t_1);
        {
          __Pyx_BufFmt_StackElem __pyx_stack[1];
          __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__xs.rcbuffer->pybuffer);
          __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd__xs.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
          if (unlikely(__pyx_t_5 < 0)) {
            PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
            if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd__xs.rcbuffer->pybuffer, (PyObject*)__pyx_v__xs, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
              Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
              __Pyx_RaiseBufferFallbackError();
            } else {
              PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
            }
            __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0;
          }
          __pyx_pybuffernd__xs.diminfo[0].strides = __pyx_pybuffernd__xs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd__xs.diminfo[0].shape = __pyx_pybuffernd__xs.rcbuffer->pybuffer.shape[0];
          if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3888, __pyx_L1_error)
        }
        __pyx_v__xs = ((PyArrayObject *)__pyx_t_1);
        __pyx_t_1 = 0;

        /* "bpf4/core.pyx":3889
 *                 else:
 *                     _xs = <ndarray>xs
 *                     for i in range(PyArray_DIM(xs, 0)):             # <<<<<<<<<<<<<<
 *                         result[i] = f(_xs[i])
 *             else:
 */
        if (!(likely(((__pyx_v_xs) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_xs, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3889, __pyx_L1_error)
        __pyx_t_19 = PyArray_DIM(((PyArrayObject *)__pyx_v_xs), 0);
        __pyx_t_20 = __pyx_t_19;
        for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_20; __pyx_t_5+=1) {
          __pyx_v_i = __pyx_t_5;

          /* "bpf4/core.pyx":3890
 *                     _xs = <ndarray>xs
 *                     for i in range(PyArray_DIM(xs, 0)):
 *                         result[i] = f(_xs[i])             # <<<<<<<<<<<<<<
 *             else:
 *                 if isinstance(xs, list):
 */
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_2 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd__xs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd__xs.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3890, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_f);
          __pyx_t_3 = __pyx_v_f; __pyx_t_6 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3890, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3890, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_18 = __pyx_v_i;
          *__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_17;
        }
      }
      __pyx_L8:;

      /* "bpf4/core.pyx":3876
 *                 result = <ndarray>out
 *                 nx = PyArray_DIM(<ndarray>result, 0)
 *             if isinstance(xs, ndarray):             # <<<<<<<<<<<<<<
 *                 if PyArray_ISCONTIGUOUS(<ndarray>xs):
 *                     data1 = <DTYPE_t *>((<ndarray>xs).data)
 */
      goto __pyx_L7;
    }

    /* "bpf4/core.pyx":3892
 *                         result[i] = f(_xs[i])
 *             else:
 *                 if isinstance(xs, list):             # <<<<<<<<<<<<<<
 *                     for i in range(nx):
 *                         result[i] = f((<list>xs)[i])
 */
    /*else*/ {
      __pyx_t_8 = PyList_Check(__pyx_v_xs); 
      __pyx_t_7 = (__pyx_t_8 != 0);
      if (__pyx_t_7) {

        /* "bpf4/core.pyx":3893
 *             else:
 *                 if isinstance(xs, list):
 *                     for i in range(nx):             # <<<<<<<<<<<<<<
 *                         result[i] = f((<list>xs)[i])
 *                 elif isinstance(xs, tuple):
 */
        __pyx_t_5 = __pyx_v_nx;
        __pyx_t_15 = __pyx_t_5;
        for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
          __pyx_v_i = __pyx_t_16;

          /* "bpf4/core.pyx":3894
 *                 if isinstance(xs, list):
 *                     for i in range(nx):
 *                         result[i] = f((<list>xs)[i])             # <<<<<<<<<<<<<<
 *                 elif isinstance(xs, tuple):
 *                     xs_as_tuple = xs
 */
          if (unlikely(__pyx_v_xs == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 3894, __pyx_L1_error)
          }
          __Pyx_INCREF(__pyx_v_f);
          __pyx_t_3 = __pyx_v_f; __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, PyList_GET_ITEM(((PyObject*)__pyx_v_xs), __pyx_v_i)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, PyList_GET_ITEM(((PyObject*)__pyx_v_xs), __pyx_v_i));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3894, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3894, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_18 = __pyx_v_i;
          *__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_17;
        }

        /* "bpf4/core.pyx":3892
 *                         result[i] = f(_xs[i])
 *             else:
 *                 if isinstance(xs, list):             # <<<<<<<<<<<<<<
 *                     for i in range(nx):
 *                         result[i] = f((<list>xs)[i])
 */
        goto __pyx_L16;
      }

      /* "bpf4/core.pyx":3895
 *                     for i in range(nx):
 *                         result[i] = f((<list>xs)[i])
 *                 elif isinstance(xs, tuple):             # <<<<<<<<<<<<<<
 *                     xs_as_tuple = xs
 *                     for i in range(len(xs_as_tuple)):
 */
      __pyx_t_7 = PyTuple_Check(__pyx_v_xs); 
      __pyx_t_8 = (__pyx_t_7 != 0);
      if (__pyx_t_8) {

        /* "bpf4/core.pyx":3896
 *                         result[i] = f((<list>xs)[i])
 *                 elif isinstance(xs, tuple):
 *                     xs_as_tuple = xs             # <<<<<<<<<<<<<<
 *                     for i in range(len(xs_as_tuple)):
 *                         result[i] = f(xs_as_tuple[i])
 */
        if (!(likely(PyTuple_CheckExact(__pyx_v_xs))||((__pyx_v_xs) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_xs)->tp_name), 0))) __PYX_ERR(0, 3896, __pyx_L1_error)
        __pyx_t_1 = __pyx_v_xs;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_v_xs_as_tuple = ((PyObject*)__pyx_t_1);
        __pyx_t_1 = 0;

        /* "bpf4/core.pyx":3897
 *                 elif isinstance(xs, tuple):
 *                     xs_as_tuple = xs
 *                     for i in range(len(xs_as_tuple)):             # <<<<<<<<<<<<<<
 *                         result[i] = f(xs_as_tuple[i])
 *                 else:
 */
        if (unlikely(__pyx_v_xs_as_tuple == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 3897, __pyx_L1_error)
        }
        __pyx_t_11 = PyTuple_GET_SIZE(__pyx_v_xs_as_tuple); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3897, __pyx_L1_error)
        __pyx_t_21 = __pyx_t_11;
        for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_21; __pyx_t_5+=1) {
          __pyx_v_i = __pyx_t_5;

          /* "bpf4/core.pyx":3898
 *                     xs_as_tuple = xs
 *                     for i in range(len(xs_as_tuple)):
 *                         result[i] = f(xs_as_tuple[i])             # <<<<<<<<<<<<<<
 *                 else:
 *                     for i in range(nx):
 */
          if (unlikely(__pyx_v_xs_as_tuple == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 3898, __pyx_L1_error)
          }
          __Pyx_INCREF(__pyx_v_f);
          __pyx_t_3 = __pyx_v_f; __pyx_t_2 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, PyTuple_GET_ITEM(__pyx_v_xs_as_tuple, __pyx_v_i)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, PyTuple_GET_ITEM(__pyx_v_xs_as_tuple, __pyx_v_i));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3898, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3898, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_18 = __pyx_v_i;
          *__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_17;
        }

        /* "bpf4/core.pyx":3895
 *                     for i in range(nx):
 *                         result[i] = f((<list>xs)[i])
 *                 elif isinstance(xs, tuple):             # <<<<<<<<<<<<<<
 *                     xs_as_tuple = xs
 *                     for i in range(len(xs_as_tuple)):
 */
        goto __pyx_L16;
      }

      /* "bpf4/core.pyx":3900
 *                         result[i] = f(xs_as_tuple[i])
 *                 else:
 *                     for i in range(nx):             # <<<<<<<<<<<<<<
 *                         result[i] = f(xs[i])
 *         return result
 */
      /*else*/ {
        __pyx_t_5 = __pyx_v_nx;
        __pyx_t_15 = __pyx_t_5;
        for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
          __pyx_v_i = __pyx_t_16;

          /* "bpf4/core.pyx":3901
 *                 else:
 *                     for i in range(nx):
 *                         result[i] = f(xs[i])             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
          __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_xs, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3901, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_v_f);
          __pyx_t_2 = __pyx_v_f; __pyx_t_6 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3901, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_17 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3901, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_18 = __pyx_v_i;
          *__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_result.diminfo[0].strides) = __pyx_t_17;
        }
      }
      __pyx_L16:;
    }
    __pyx_L7:;
  }

  /* "bpf4/core.pyx":3902
 *                     for i in range(nx):
 *                         result[i] = f(xs[i])
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyArrayObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "bpf4/core.pyx":3846
 *         return _FunctionWrap_Object_OutboundConst_new(self, x0, x1)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__xs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd__xs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v__xs);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_xs_as_tuple);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_7map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_20_FunctionWrap_Object_6map[] = "_FunctionWrap_Object.map(self, xs, ndarray out=None) -> ndarray\n\n        the same as map(self, xs) but somewhat faster\n\n        xs can also be a number, in which case it is interpreted as\n        the number of elements to calculate in an evenly spaced\n        grid between the bounds of this bpf.\n        bpf.map(10) == bpf.map(numpy.linspace(x0, x1, 10))\n\n        if out is given, the result if put into it. it must have the \n        same shape as xs\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_20_FunctionWrap_Object_7map = {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_7map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_20_FunctionWrap_Object_6map};
static PyObject *__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_7map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_out,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 3846, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_out = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3846, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 3846, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_20_FunctionWrap_Object_6map(((struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *)__pyx_v_self), __pyx_v_xs, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_20_FunctionWrap_Object_6map(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__FunctionWrap_Object->__pyx_base.map(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_xs, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3904
 *         return result
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         xs = numpy.linspace(x0, x1, n)
 *         return self.map(xs, out=out)
 */

static PyObject *__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_9mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_20_FunctionWrap_Object_mapn_between(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_20_FunctionWrap_Object_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  PyObject *__pyx_v_xs = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3904, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_9mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3904, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3904, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3904, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3904, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3904, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3904, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3904, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3904, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3905
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         xs = numpy.linspace(x0, x1, n)             # <<<<<<<<<<<<<<
 *         return self.map(xs, out=out)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_linspace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_2, __pyx_t_9, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3905, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_2, __pyx_t_9, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3905, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_8, __pyx_t_5);
    __pyx_t_2 = 0;
    __pyx_t_9 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_xs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":3906
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         xs = numpy.linspace(x0, x1, n)
 *         return self.map(xs, out=out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_10.__pyx_n = 1;
  __pyx_t_10.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core__FunctionWrap_Object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.map(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_xs, 0, &__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3904
 *         return result
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         xs = numpy.linspace(x0, x1, n)
 *         return self.map(xs, out=out)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xs);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_9mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_20_FunctionWrap_Object_8mapn_between[] = "_FunctionWrap_Object.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray";
static PyMethodDef __pyx_mdef_4bpf4_4core_20_FunctionWrap_Object_9mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_9mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_20_FunctionWrap_Object_8mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_9mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 3904, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 3904, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 3904, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3904, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3904, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3904, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3904, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 3904, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_20_FunctionWrap_Object_8mapn_between(((struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_20_FunctionWrap_Object_8mapn_between(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__FunctionWrap_Object->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3911
 * cdef class _FunctionWrap_Object_OutboundConst(_FunctionWrap_Object):
 *     cdef double y0, y1
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         if x < self._x0:
 *             return self.y0
 */

static double __pyx_f_4bpf4_4core_34_FunctionWrap_Object_OutboundConst___ccall__(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object_OutboundConst *__pyx_v_self, double __pyx_v_x) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  double __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("__ccall__", 0);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif

  /* "bpf4/core.pyx":3912
 *     cdef double y0, y1
 *     cdef double __ccall__(self, double x) nogil:
 *         if x < self._x0:             # <<<<<<<<<<<<<<
 *             return self.y0
 *         elif x > self._x1:
 */
  /*try:*/ {
    __pyx_t_1 = ((__pyx_v_x < __pyx_v_self->__pyx_base.__pyx_base._x0) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":3913
 *     cdef double __ccall__(self, double x) nogil:
 *         if x < self._x0:
 *             return self.y0             # <<<<<<<<<<<<<<
 *         elif x > self._x1:
 *             return self.y1
 */
      __pyx_r = __pyx_v_self->y0;
      goto __pyx_L3_return;

      /* "bpf4/core.pyx":3912
 *     cdef double y0, y1
 *     cdef double __ccall__(self, double x) nogil:
 *         if x < self._x0:             # <<<<<<<<<<<<<<
 *             return self.y0
 *         elif x > self._x1:
 */
    }

    /* "bpf4/core.pyx":3914
 *         if x < self._x0:
 *             return self.y0
 *         elif x > self._x1:             # <<<<<<<<<<<<<<
 *             return self.y1
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_x > __pyx_v_self->__pyx_base.__pyx_base._x1) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":3915
 *             return self.y0
 *         elif x > self._x1:
 *             return self.y1             # <<<<<<<<<<<<<<
 *         else:
 *             with gil:
 */
      __pyx_r = __pyx_v_self->y1;
      goto __pyx_L3_return;

      /* "bpf4/core.pyx":3914
 *         if x < self._x0:
 *             return self.y0
 *         elif x > self._x1:             # <<<<<<<<<<<<<<
 *             return self.y1
 *         else:
 */
    }

    /* "bpf4/core.pyx":3917
 *             return self.y1
 *         else:
 *             with gil:             # <<<<<<<<<<<<<<
 *                 return self.f(x)
 * 
 */
    /*else*/ {
      {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          #endif
          /*try:*/ {

            /* "bpf4/core.pyx":3918
 *         else:
 *             with gil:
 *                 return self.f(x)             # <<<<<<<<<<<<<<
 * 
 * 
 */
            __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3918, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_v_self->__pyx_base.f);
            __pyx_t_4 = __pyx_v_self->__pyx_base.f; __pyx_t_5 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3918, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3918, __pyx_L8_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_r = __pyx_t_6;
            goto __pyx_L7_return;
          }

          /* "bpf4/core.pyx":3917
 *             return self.y1
 *         else:
 *             with gil:             # <<<<<<<<<<<<<<
 *                 return self.f(x)
 * 
 */
          /*finally:*/ {
            __pyx_L7_return: {
              #ifdef WITH_THREAD
              __Pyx_PyGILState_Release(__pyx_gilstate_save);
              #endif
              goto __pyx_L3_return;
            }
            __pyx_L8_error: {
              #ifdef WITH_THREAD
              __Pyx_PyGILState_Release(__pyx_gilstate_save);
              #endif
              goto __pyx_L4_error;
            }
          }
      }
    }
  }

  /* "bpf4/core.pyx":3912
 *     cdef double y0, y1
 *     cdef double __ccall__(self, double x) nogil:
 *         if x < self._x0:             # <<<<<<<<<<<<<<
 *             return self.y0
 *         elif x > self._x1:
 */
  /*finally:*/ {
    __pyx_L3_return: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L0;
    }
    __pyx_L4_error: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L1_error;
    }
  }

  /* "bpf4/core.pyx":3911
 * cdef class _FunctionWrap_Object_OutboundConst(_FunctionWrap_Object):
 *     cdef double y0, y1
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         if x < self._x0:
 *             return self.y0
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("bpf4.core._FunctionWrap_Object_OutboundConst.__ccall__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
  __pyx_r = 0;
  __pyx_L0:;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "bpf4/core.pyx":3921
 * 
 * 
 * cdef _FunctionWrap_Object_OutboundConst _FunctionWrap_Object_OutboundConst_new(_FunctionWrap_Object bpf, double x0, double x1):             # <<<<<<<<<<<<<<
 *     cdef _FunctionWrap_Object_OutboundConst out = _FunctionWrap_Object_OutboundConst(bpf.f, (x0, x1))
 *     out.y0 = out.f(x0)
 */

static struct __pyx_obj_4bpf4_4core__FunctionWrap_Object_OutboundConst *__pyx_f_4bpf4_4core__FunctionWrap_Object_OutboundConst_new(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *__pyx_v_bpf, double __pyx_v_x0, double __pyx_v_x1) {
  struct __pyx_obj_4bpf4_4core__FunctionWrap_Object_OutboundConst *__pyx_v_out = 0;
  struct __pyx_obj_4bpf4_4core__FunctionWrap_Object_OutboundConst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_FunctionWrap_Object_OutboundConst_new", 0);

  /* "bpf4/core.pyx":3922
 * 
 * cdef _FunctionWrap_Object_OutboundConst _FunctionWrap_Object_OutboundConst_new(_FunctionWrap_Object bpf, double x0, double x1):
 *     cdef _FunctionWrap_Object_OutboundConst out = _FunctionWrap_Object_OutboundConst(bpf.f, (x0, x1))             # <<<<<<<<<<<<<<
 *     out.y0 = out.f(x0)
 *     out.y1 = out.f(x1)
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_bpf->f);
  __Pyx_GIVEREF(__pyx_v_bpf->f);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_bpf->f);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__FunctionWrap_Object_OutboundConst), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_out = ((struct __pyx_obj_4bpf4_4core__FunctionWrap_Object_OutboundConst *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "bpf4/core.pyx":3923
 * cdef _FunctionWrap_Object_OutboundConst _FunctionWrap_Object_OutboundConst_new(_FunctionWrap_Object bpf, double x0, double x1):
 *     cdef _FunctionWrap_Object_OutboundConst out = _FunctionWrap_Object_OutboundConst(bpf.f, (x0, x1))
 *     out.y0 = out.f(x0)             # <<<<<<<<<<<<<<
 *     out.y1 = out.f(x1)
 *     return out
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_out->__pyx_base.f);
  __pyx_t_1 = __pyx_v_out->__pyx_base.f; __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3923, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_out->y0 = __pyx_t_5;

  /* "bpf4/core.pyx":3924
 *     cdef _FunctionWrap_Object_OutboundConst out = _FunctionWrap_Object_OutboundConst(bpf.f, (x0, x1))
 *     out.y0 = out.f(x0)
 *     out.y1 = out.f(x1)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_out->__pyx_base.f);
  __pyx_t_2 = __pyx_v_out->__pyx_base.f; __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3924, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_out->y1 = __pyx_t_5;

  /* "bpf4/core.pyx":3925
 *     out.y0 = out.f(x0)
 *     out.y1 = out.f(x1)
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3921
 * 
 * 
 * cdef _FunctionWrap_Object_OutboundConst _FunctionWrap_Object_OutboundConst_new(_FunctionWrap_Object bpf, double x0, double x1):             # <<<<<<<<<<<<<<
 *     cdef _FunctionWrap_Object_OutboundConst out = _FunctionWrap_Object_OutboundConst(bpf.f, (x0, x1))
 *     out.y0 = out.f(x0)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._FunctionWrap_Object_OutboundConst_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3935
 *     cdef double value
 * 
 *     def __init__(self, double value, bounds: tuple[float, float]=None):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_5Const_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_5Const___init__[] = "\n        Args:\n            value (float): the constant value of this bpf\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_5Const___init__;
#endif
static int __pyx_pw_4bpf4_4core_5Const_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_value;
  PyObject *__pyx_v_bounds = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_bounds,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bounds);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3935, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_value = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3935, __pyx_L3_error)
    __pyx_v_bounds = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3935, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Const.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_5Const___init__(((struct __pyx_obj_4bpf4_4core_Const *)__pyx_v_self), __pyx_v_value, __pyx_v_bounds);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_5Const___init__(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, double __pyx_v_value, PyObject *__pyx_v_bounds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  double __pyx_t_3;
  double __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":3940
 *             value (float): the constant value of this bpf
 *         """
 *         if bounds:             # <<<<<<<<<<<<<<
 *             self._set_bounds(bounds[0], bounds[1])
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_bounds); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3940, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":3941
 *         """
 *         if bounds:
 *             self._set_bounds(bounds[0], bounds[1])             # <<<<<<<<<<<<<<
 *         else:
 *             self._set_bounds(INFNEG, INF)
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3941, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3941, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3941, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3941, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_t_3, __pyx_t_4);

    /* "bpf4/core.pyx":3940
 *             value (float): the constant value of this bpf
 *         """
 *         if bounds:             # <<<<<<<<<<<<<<
 *             self._set_bounds(bounds[0], bounds[1])
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":3943
 *             self._set_bounds(bounds[0], bounds[1])
 *         else:
 *             self._set_bounds(INFNEG, INF)             # <<<<<<<<<<<<<<
 *         self.value = value
 * 
 */
  /*else*/ {
    __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), (-Py_HUGE_VAL), Py_HUGE_VAL);
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":3944
 *         else:
 *             self._set_bounds(INFNEG, INF)
 *         self.value = value             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, x): return self.value
 */
  __pyx_v_self->value = __pyx_v_value;

  /* "bpf4/core.pyx":3935
 *     cdef double value
 * 
 *     def __init__(self, double value, bounds: tuple[float, float]=None):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core.Const.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3946
 *         self.value = value
 * 
 *     def __call__(self, x): return self.value             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Const_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_5Const_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 3946, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_x = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3946, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Const.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_5Const_2__call__(((struct __pyx_obj_4bpf4_4core_Const *)__pyx_v_self), __pyx_v_x);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Const_2__call__(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__call__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Const.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3948
 *     def __call__(self, x): return self.value
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         return self.value
 * 
 */

static double __pyx_f_4bpf4_4core_5Const___ccall__(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, CYTHON_UNUSED double __pyx_v_x) {
  double __pyx_r;

  /* "bpf4/core.pyx":3949
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         return self.value             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_r = __pyx_v_self->value;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3948
 *     def __call__(self, x): return self.value
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         return self.value
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":3951
 *         return self.value
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.value,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Const_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_5Const_4__getstate__[] = "Const.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_5Const_5__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_5Const_5__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_5Const_4__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_5Const_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Const_4__getstate__(((struct __pyx_obj_4bpf4_4core_Const *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Const_4__getstate__(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":3952
 * 
 *     def __getstate__(self):
 *         return (self.value,)             # <<<<<<<<<<<<<<
 * 
 *     def _get_points_for_rendering(self, int n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3951
 *         return self.value
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.value,)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core.Const.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3954
 *         return (self.value,)
 * 
 *     def _get_points_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         x0 = self._x0 if self._x0 > INFNEG else 0.
 *         x1 = self._x1 if self._x1 < INF else 1.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Const_7_get_points_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
static char __pyx_doc_4bpf4_4core_5Const_6_get_points_for_rendering[] = "Const._get_points_for_rendering(self, int n)";
static PyMethodDef __pyx_mdef_4bpf4_4core_5Const_7_get_points_for_rendering = {"_get_points_for_rendering", (PyCFunction)__pyx_pw_4bpf4_4core_5Const_7_get_points_for_rendering, METH_O, __pyx_doc_4bpf4_4core_5Const_6_get_points_for_rendering};
static PyObject *__pyx_pw_4bpf4_4core_5Const_7_get_points_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
  CYTHON_UNUSED int __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_points_for_rendering (wrapper)", 0);
  assert(__pyx_arg_n); {
    __pyx_v_n = __Pyx_PyInt_As_int(__pyx_arg_n); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3954, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Const._get_points_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_5Const_6_get_points_for_rendering(((struct __pyx_obj_4bpf4_4core_Const *)__pyx_v_self), ((int)__pyx_v_n));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Const_6_get_points_for_rendering(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, CYTHON_UNUSED int __pyx_v_n) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_points_for_rendering", 0);

  /* "bpf4/core.pyx":3955
 * 
 *     def _get_points_for_rendering(self, int n):
 *         x0 = self._x0 if self._x0 > INFNEG else 0.             # <<<<<<<<<<<<<<
 *         x1 = self._x1 if self._x1 < INF else 1.
 *         return numpy.array([x0, x1]), numpy.array([self.value, self.value])
 */
  if (((__pyx_v_self->__pyx_base._x0 > (-Py_HUGE_VAL)) != 0)) {
    __pyx_t_1 = __pyx_v_self->__pyx_base._x0;
  } else {
    __pyx_t_1 = 0.;
  }
  __pyx_v_x0 = __pyx_t_1;

  /* "bpf4/core.pyx":3956
 *     def _get_points_for_rendering(self, int n):
 *         x0 = self._x0 if self._x0 > INFNEG else 0.
 *         x1 = self._x1 if self._x1 < INF else 1.             # <<<<<<<<<<<<<<
 *         return numpy.array([x0, x1]), numpy.array([self.value, self.value])
 * 
 */
  if (((__pyx_v_self->__pyx_base._x1 < Py_HUGE_VAL) != 0)) {
    __pyx_t_1 = __pyx_v_self->__pyx_base._x1;
  } else {
    __pyx_t_1 = 1.;
  }
  __pyx_v_x1 = __pyx_t_1;

  /* "bpf4/core.pyx":3957
 *         x0 = self._x0 if self._x0 > INFNEG else 0.
 *         x1 = self._x1 if self._x1 < INF else 1.
 *         return numpy.array([x0, x1]), numpy.array([self.value, self.value])             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, slice):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
  __pyx_t_6 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3954
 *         return (self.value,)
 * 
 *     def _get_points_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         x0 = self._x0 if self._x0 > INFNEG else 0.
 *         x1 = self._x1 if self._x1 < INF else 1.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bpf4.core.Const._get_points_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3959
 *         return numpy.array([x0, x1]), numpy.array([self.value, self.value])
 * 
 *     def __getitem__(self, slice):             # <<<<<<<<<<<<<<
 *         if not hasattr(slice, 'start'):
 *             raise ValueError("BPFs accept only slices, not single items.")
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Const_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_slice); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_5Const_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_slice) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_5Const_8__getitem__(((struct __pyx_obj_4bpf4_4core_Const *)__pyx_v_self), ((PyObject *)__pyx_v_slice));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Const_8__getitem__(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, PyObject *__pyx_v_slice) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  double __pyx_t_4;
  double __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "bpf4/core.pyx":3960
 * 
 *     def __getitem__(self, slice):
 *         if not hasattr(slice, 'start'):             # <<<<<<<<<<<<<<
 *             raise ValueError("BPFs accept only slices, not single items.")
 *         cdef double x0 = slice.start if slice.start is not None else self._x0
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_slice, __pyx_n_u_start); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 3960, __pyx_L1_error)
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "bpf4/core.pyx":3961
 *     def __getitem__(self, slice):
 *         if not hasattr(slice, 'start'):
 *             raise ValueError("BPFs accept only slices, not single items.")             # <<<<<<<<<<<<<<
 *         cdef double x0 = slice.start if slice.start is not None else self._x0
 *         cdef double x1 = slice.stop if slice.stop is not None else self._x1
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3961, __pyx_L1_error)

    /* "bpf4/core.pyx":3960
 * 
 *     def __getitem__(self, slice):
 *         if not hasattr(slice, 'start'):             # <<<<<<<<<<<<<<
 *             raise ValueError("BPFs accept only slices, not single items.")
 *         cdef double x0 = slice.start if slice.start is not None else self._x0
 */
  }

  /* "bpf4/core.pyx":3962
 *         if not hasattr(slice, 'start'):
 *             raise ValueError("BPFs accept only slices, not single items.")
 *         cdef double x0 = slice.start if slice.start is not None else self._x0             # <<<<<<<<<<<<<<
 *         cdef double x1 = slice.stop if slice.stop is not None else self._x1
 *         cdef BpfInterface out = Const(self.value)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_slice, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((__pyx_t_2 != 0)) {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_slice, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3962, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __pyx_t_5;
  } else {
    __pyx_t_4 = __pyx_v_self->__pyx_base._x0;
  }
  __pyx_v_x0 = __pyx_t_4;

  /* "bpf4/core.pyx":3963
 *             raise ValueError("BPFs accept only slices, not single items.")
 *         cdef double x0 = slice.start if slice.start is not None else self._x0
 *         cdef double x1 = slice.stop if slice.stop is not None else self._x1             # <<<<<<<<<<<<<<
 *         cdef BpfInterface out = Const(self.value)
 *         out._set_bounds(x0, x1)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_slice, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((__pyx_t_2 != 0)) {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_slice, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3963, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __pyx_t_5;
  } else {
    __pyx_t_4 = __pyx_v_self->__pyx_base._x1;
  }
  __pyx_v_x1 = __pyx_t_4;

  /* "bpf4/core.pyx":3964
 *         cdef double x0 = slice.start if slice.start is not None else self._x0
 *         cdef double x1 = slice.stop if slice.stop is not None else self._x1
 *         cdef BpfInterface out = Const(self.value)             # <<<<<<<<<<<<<<
 *         out._set_bounds(x0, x1)
 *         return out
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4bpf4_4core_Const), __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_out = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "bpf4/core.pyx":3965
 *         cdef double x1 = slice.stop if slice.stop is not None else self._x1
 *         cdef BpfInterface out = Const(self.value)
 *         out._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(__pyx_v_out, __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":3966
 *         cdef BpfInterface out = Const(self.value)
 *         out._set_bounds(x0, x1)
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "bpf4/core.pyx":3959
 *         return numpy.array([x0, x1]), numpy.array([self.value, self.value])
 * 
 *     def __getitem__(self, slice):             # <<<<<<<<<<<<<<
 *         if not hasattr(slice, 'start'):
 *             raise ValueError("BPFs accept only slices, not single items.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core.Const.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3968
 *         return out
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if out is not None:
 *             out[...] = self.value
 */

static PyObject *__pyx_pw_4bpf4_4core_5Const_11mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_5Const_mapn_between(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, int __pyx_v_n, CYTHON_UNUSED double __pyx_v_x0, CYTHON_UNUSED double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_5Const_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  __Pyx_memviewslice __pyx_v_out2 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_t_13;
  int __pyx_t_14;
  double __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3968, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_5Const_11mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3968, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3968, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3968, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3968, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3968, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3968, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3968, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3968, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":3969
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         if out is not None:             # <<<<<<<<<<<<<<
 *             out[...] = self.value
 *             return out
 */
  __pyx_t_10 = (((PyObject *)__pyx_v_out) != Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":3970
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         if out is not None:
 *             out[...] = self.value             # <<<<<<<<<<<<<<
 *             return out
 *         cdef double[::1] out2 = EMPTY1D(n)
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_out), Py_Ellipsis, __pyx_t_1) < 0)) __PYX_ERR(0, 3970, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bpf4/core.pyx":3971
 *         if out is not None:
 *             out[...] = self.value
 *             return out             # <<<<<<<<<<<<<<
 *         cdef double[::1] out2 = EMPTY1D(n)
 *         cdef int i
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = __pyx_v_out;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3969
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         if out is not None:             # <<<<<<<<<<<<<<
 *             out[...] = self.value
 *             return out
 */
  }

  /* "bpf4/core.pyx":3972
 *             out[...] = self.value
 *             return out
 *         cdef double[::1] out2 = EMPTY1D(n)             # <<<<<<<<<<<<<<
 *         cdef int i
 *         for i in range(n):
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 3972, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_out2 = __pyx_t_12;
  __pyx_t_12.memview = NULL;
  __pyx_t_12.data = NULL;

  /* "bpf4/core.pyx":3974
 *         cdef double[::1] out2 = EMPTY1D(n)
 *         cdef int i
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             out2[i] = self.value
 *         return numpy.asarray(out2)
 */
  __pyx_t_8 = __pyx_v_n;
  __pyx_t_13 = __pyx_t_8;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
    __pyx_v_i = __pyx_t_14;

    /* "bpf4/core.pyx":3975
 *         cdef int i
 *         for i in range(n):
 *             out2[i] = self.value             # <<<<<<<<<<<<<<
 *         return numpy.asarray(out2)
 * 
 */
    __pyx_t_15 = __pyx_v_self->value;
    __pyx_t_16 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_out2.data) + __pyx_t_16)) )) = __pyx_t_15;
  }

  /* "bpf4/core.pyx":3976
 *         for i in range(n):
 *             out2[i] = self.value
 *         return numpy.asarray(out2)             # <<<<<<<<<<<<<<
 * 
 * cdef _create_lambda_unordered(a, b, class_bin, class_const):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_out2, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3976, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3968
 *         return out
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if out is not None:
 *             out[...] = self.value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
  __Pyx_AddTraceback("bpf4.core.Const.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_out2, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_5Const_11mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_5Const_10mapn_between[] = "Const.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray";
static PyMethodDef __pyx_mdef_4bpf4_4core_5Const_11mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_5Const_11mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_5Const_10mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_5Const_11mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 3968, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 3968, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 3968, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3968, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3968, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3968, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3968, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.Const.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 3968, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_5Const_10mapn_between(((struct __pyx_obj_4bpf4_4core_Const *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_5Const_10mapn_between(struct __pyx_obj_4bpf4_4core_Const *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core_Const->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.Const.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3978
 *         return numpy.asarray(out2)
 * 
 * cdef _create_lambda_unordered(a, b, class_bin, class_const):             # <<<<<<<<<<<<<<
 *     if isinstance(a, BpfInterface):
 *         if isinstance(b, BpfInterface):
 */

static PyObject *__pyx_f_4bpf4_4core__create_lambda_unordered(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_class_bin, PyObject *__pyx_v_class_const) {
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_create_lambda_unordered", 0);

  /* "bpf4/core.pyx":3979
 * 
 * cdef _create_lambda_unordered(a, b, class_bin, class_const):
 *     if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *         if isinstance(b, BpfInterface):
 *             out = class_bin(a, b, _get_bounds(a, b))
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":3980
 * cdef _create_lambda_unordered(a, b, class_bin, class_const):
 *     if isinstance(a, BpfInterface):
 *         if isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             out = class_bin(a, b, _get_bounds(a, b))
 *         elif callable(b):
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_4bpf4_4core_BpfInterface); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":3981
 *     if isinstance(a, BpfInterface):
 *         if isinstance(b, BpfInterface):
 *             out = class_bin(a, b, _get_bounds(a, b))             # <<<<<<<<<<<<<<
 *         elif callable(b):
 *             out = class_bin(a, _FunctionWrap(b), a.bounds())
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_bounds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3981, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_a, __pyx_v_b};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3981, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_a, __pyx_v_b};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3981, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3981, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_a);
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_b);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3981, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_v_class_bin);
      __pyx_t_5 = __pyx_v_class_bin; __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_a, __pyx_v_b, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3981, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_a, __pyx_v_b, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3981, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3981, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_a);
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_b);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3981, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_out = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "bpf4/core.pyx":3980
 * cdef _create_lambda_unordered(a, b, class_bin, class_const):
 *     if isinstance(a, BpfInterface):
 *         if isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             out = class_bin(a, b, _get_bounds(a, b))
 *         elif callable(b):
 */
      goto __pyx_L4;
    }

    /* "bpf4/core.pyx":3982
 *         if isinstance(b, BpfInterface):
 *             out = class_bin(a, b, _get_bounds(a, b))
 *         elif callable(b):             # <<<<<<<<<<<<<<
 *             out = class_bin(a, _FunctionWrap(b), a.bounds())
 *         else:
 */
    __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_b); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 3982, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":3983
 *             out = class_bin(a, b, _get_bounds(a, b))
 *         elif callable(b):
 *             out = class_bin(a, _FunctionWrap(b), a.bounds())             # <<<<<<<<<<<<<<
 *         else:
 *             out = class_const(a, b, a.bounds())
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_FunctionWrap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_b) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_b);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_bounds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_v_class_bin);
      __pyx_t_4 = __pyx_v_class_bin; __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_a, __pyx_t_5, __pyx_t_6};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3983, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_a, __pyx_t_5, __pyx_t_6};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3983, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3983, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_v_a);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_7, __pyx_t_6);
        __pyx_t_5 = 0;
        __pyx_t_6 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3983, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_out = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "bpf4/core.pyx":3982
 *         if isinstance(b, BpfInterface):
 *             out = class_bin(a, b, _get_bounds(a, b))
 *         elif callable(b):             # <<<<<<<<<<<<<<
 *             out = class_bin(a, _FunctionWrap(b), a.bounds())
 *         else:
 */
      goto __pyx_L4;
    }

    /* "bpf4/core.pyx":3985
 *             out = class_bin(a, _FunctionWrap(b), a.bounds())
 *         else:
 *             out = class_const(a, b, a.bounds())             # <<<<<<<<<<<<<<
 *         return out
 *     elif isinstance(b, BpfInterface):
 */
    /*else*/ {
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_bounds); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_INCREF(__pyx_v_class_const);
      __pyx_t_9 = __pyx_v_class_const; __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_9)) {
        PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_a, __pyx_v_b, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3985, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
        PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_a, __pyx_v_b, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3985, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3985, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_a);
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_b);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_7, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3985, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_out = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_L4:;

    /* "bpf4/core.pyx":3986
 *         else:
 *             out = class_const(a, b, a.bounds())
 *         return out             # <<<<<<<<<<<<<<
 *     elif isinstance(b, BpfInterface):
 *         if callable(a):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_out);
    __pyx_r = __pyx_v_out;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3979
 * 
 * cdef _create_lambda_unordered(a, b, class_bin, class_const):
 *     if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *         if isinstance(b, BpfInterface):
 *             out = class_bin(a, b, _get_bounds(a, b))
 */
  }

  /* "bpf4/core.pyx":3987
 *             out = class_const(a, b, a.bounds())
 *         return out
 *     elif isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *         if callable(a):
 *             out = class_bin(b, _FunctionWrap(a), a.bounds())
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":3988
 *         return out
 *     elif isinstance(b, BpfInterface):
 *         if callable(a):             # <<<<<<<<<<<<<<
 *             out = class_bin(b, _FunctionWrap(a), a.bounds())
 *         else:
 */
    __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_a); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 3988, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":3989
 *     elif isinstance(b, BpfInterface):
 *         if callable(a):
 *             out = class_bin(b, _FunctionWrap(a), a.bounds())             # <<<<<<<<<<<<<<
 *         else:
 *             out = class_const(b, a, b.bounds())
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FunctionWrap); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_9 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_a) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_a);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_bounds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_v_class_bin);
      __pyx_t_4 = __pyx_v_class_bin; __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_b, __pyx_t_9, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3989, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_b, __pyx_t_9, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3989, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_b);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
        __pyx_t_9 = 0;
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_out = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "bpf4/core.pyx":3988
 *         return out
 *     elif isinstance(b, BpfInterface):
 *         if callable(a):             # <<<<<<<<<<<<<<
 *             out = class_bin(b, _FunctionWrap(a), a.bounds())
 *         else:
 */
      goto __pyx_L5;
    }

    /* "bpf4/core.pyx":3991
 *             out = class_bin(b, _FunctionWrap(a), a.bounds())
 *         else:
 *             out = class_const(b, a, b.bounds())             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
    /*else*/ {
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_bounds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_v_class_const);
      __pyx_t_8 = __pyx_v_class_const; __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_b, __pyx_v_a, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3991, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_b, __pyx_v_a, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3991, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_v_b);
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_v_a);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_7, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_out = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_L5:;

    /* "bpf4/core.pyx":3992
 *         else:
 *             out = class_const(b, a, b.bounds())
 *         return out             # <<<<<<<<<<<<<<
 * 
 * cdef _create_lambda(BpfInterface a, object b, class_bin, class_const):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_out);
    __pyx_r = __pyx_v_out;
    goto __pyx_L0;

    /* "bpf4/core.pyx":3987
 *             out = class_const(a, b, a.bounds())
 *         return out
 *     elif isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *         if callable(a):
 *             out = class_bin(b, _FunctionWrap(a), a.bounds())
 */
  }

  /* "bpf4/core.pyx":3978
 *         return numpy.asarray(out2)
 * 
 * cdef _create_lambda_unordered(a, b, class_bin, class_const):             # <<<<<<<<<<<<<<
 *     if isinstance(a, BpfInterface):
 *         if isinstance(b, BpfInterface):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bpf4.core._create_lambda_unordered", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":3994
 *         return out
 * 
 * cdef _create_lambda(BpfInterface a, object b, class_bin, class_const):             # <<<<<<<<<<<<<<
 *     if isinstance(b, BpfInterface):
 *         out = class_bin(a, b, _get_bounds(a, b))
 */

static PyObject *__pyx_f_4bpf4_4core__create_lambda(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_class_bin, PyObject *__pyx_v_class_const) {
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_create_lambda", 0);

  /* "bpf4/core.pyx":3995
 * 
 * cdef _create_lambda(BpfInterface a, object b, class_bin, class_const):
 *     if isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *         out = class_bin(a, b, _get_bounds(a, b))
 *     elif callable(b):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":3996
 * cdef _create_lambda(BpfInterface a, object b, class_bin, class_const):
 *     if isinstance(b, BpfInterface):
 *         out = class_bin(a, b, _get_bounds(a, b))             # <<<<<<<<<<<<<<
 *     elif callable(b):
 *         out = class_bin(a, _FunctionWrap(b), a.bounds())
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_bounds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_a), __pyx_v_b};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3996, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_a), __pyx_v_b};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3996, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3996, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_a));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_a));
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_a));
      __Pyx_INCREF(__pyx_v_b);
      __Pyx_GIVEREF(__pyx_v_b);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_b);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3996, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_v_class_bin);
    __pyx_t_5 = __pyx_v_class_bin; __pyx_t_8 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[4] = {__pyx_t_8, ((PyObject *)__pyx_v_a), __pyx_v_b, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3996, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[4] = {__pyx_t_8, ((PyObject *)__pyx_v_a), __pyx_v_b, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3996, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3996, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_a));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_a));
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, ((PyObject *)__pyx_v_a));
      __Pyx_INCREF(__pyx_v_b);
      __Pyx_GIVEREF(__pyx_v_b);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_b);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3996, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_out = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "bpf4/core.pyx":3995
 * 
 * cdef _create_lambda(BpfInterface a, object b, class_bin, class_const):
 *     if isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *         out = class_bin(a, b, _get_bounds(a, b))
 *     elif callable(b):
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":3997
 *     if isinstance(b, BpfInterface):
 *         out = class_bin(a, b, _get_bounds(a, b))
 *     elif callable(b):             # <<<<<<<<<<<<<<
 *         out = class_bin(a, _FunctionWrap(b), a.bounds())
 *     else:
 */
  __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_b); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 3997, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":3998
 *         out = class_bin(a, b, _get_bounds(a, b))
 *     elif callable(b):
 *         out = class_bin(a, _FunctionWrap(b), a.bounds())             # <<<<<<<<<<<<<<
 *     else:
 *         out = class_const(a, b, a.bounds())
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_FunctionWrap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3998, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_b) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_b);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3998, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_bounds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3998, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3998, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_v_class_bin);
    __pyx_t_4 = __pyx_v_class_bin; __pyx_t_8 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_8, ((PyObject *)__pyx_v_a), __pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3998, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_8, ((PyObject *)__pyx_v_a), __pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3998, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3998, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_a));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_a));
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, ((PyObject *)__pyx_v_a));
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_7, __pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3998, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_out = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "bpf4/core.pyx":3997
 *     if isinstance(b, BpfInterface):
 *         out = class_bin(a, b, _get_bounds(a, b))
 *     elif callable(b):             # <<<<<<<<<<<<<<
 *         out = class_bin(a, _FunctionWrap(b), a.bounds())
 *     else:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":4000
 *         out = class_bin(a, _FunctionWrap(b), a.bounds())
 *     else:
 *         out = class_const(a, b, a.bounds())             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  /*else*/ {
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_bounds); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_INCREF(__pyx_v_class_const);
    __pyx_t_9 = __pyx_v_class_const; __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[4] = {__pyx_t_6, ((PyObject *)__pyx_v_a), __pyx_v_b, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4000, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[4] = {__pyx_t_6, ((PyObject *)__pyx_v_a), __pyx_v_b, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4000, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4000, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_a));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_a));
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, ((PyObject *)__pyx_v_a));
      __Pyx_INCREF(__pyx_v_b);
      __Pyx_GIVEREF(__pyx_v_b);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_b);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_7, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4000, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_v_out = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":4001
 *     else:
 *         out = class_const(a, b, a.bounds())
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef _create_rlambda(object a, object b, class_bin, class_const, class_rbin=None, class_rconst=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bpf4/core.pyx":3994
 *         return out
 * 
 * cdef _create_lambda(BpfInterface a, object b, class_bin, class_const):             # <<<<<<<<<<<<<<
 *     if isinstance(b, BpfInterface):
 *         out = class_bin(a, b, _get_bounds(a, b))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bpf4.core._create_lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4003
 *     return out
 * 
 * cdef _create_rlambda(object a, object b, class_bin, class_const, class_rbin=None, class_rconst=None):             # <<<<<<<<<<<<<<
 *     if isinstance(a, BpfInterface):
 *         if isinstance(b, BpfInterface):
 */

static PyObject *__pyx_f_4bpf4_4core__create_rlambda(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_class_bin, PyObject *__pyx_v_class_const, struct __pyx_opt_args_4bpf4_4core__create_rlambda *__pyx_optional_args) {
  PyObject *__pyx_v_class_rbin = ((PyObject *)Py_None);
  PyObject *__pyx_v_class_rconst = ((PyObject *)Py_None);
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_create_rlambda", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_class_rbin = __pyx_optional_args->class_rbin;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_class_rconst = __pyx_optional_args->class_rconst;
      }
    }
  }

  /* "bpf4/core.pyx":4004
 * 
 * cdef _create_rlambda(object a, object b, class_bin, class_const, class_rbin=None, class_rconst=None):
 *     if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *         if isinstance(b, BpfInterface):
 *             out = class_bin(a, b, _get_bounds(a, b))
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":4005
 * cdef _create_rlambda(object a, object b, class_bin, class_const, class_rbin=None, class_rconst=None):
 *     if isinstance(a, BpfInterface):
 *         if isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             out = class_bin(a, b, _get_bounds(a, b))
 *         elif callable(b):
 */
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_4bpf4_4core_BpfInterface); 
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":4006
 *     if isinstance(a, BpfInterface):
 *         if isinstance(b, BpfInterface):
 *             out = class_bin(a, b, _get_bounds(a, b))             # <<<<<<<<<<<<<<
 *         elif callable(b):
 *             out = class_bin(a, _FunctionWrap(b), a.bounds())
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_bounds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4006, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_a, __pyx_v_b};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4006, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_a, __pyx_v_b};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4006, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4006, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_a);
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_b);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4006, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_v_class_bin);
      __pyx_t_5 = __pyx_v_class_bin; __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_a, __pyx_v_b, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4006, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_a, __pyx_v_b, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4006, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4006, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_a);
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_b);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4006, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_out = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "bpf4/core.pyx":4005
 * cdef _create_rlambda(object a, object b, class_bin, class_const, class_rbin=None, class_rconst=None):
 *     if isinstance(a, BpfInterface):
 *         if isinstance(b, BpfInterface):             # <<<<<<<<<<<<<<
 *             out = class_bin(a, b, _get_bounds(a, b))
 *         elif callable(b):
 */
      goto __pyx_L4;
    }

    /* "bpf4/core.pyx":4007
 *         if isinstance(b, BpfInterface):
 *             out = class_bin(a, b, _get_bounds(a, b))
 *         elif callable(b):             # <<<<<<<<<<<<<<
 *             out = class_bin(a, _FunctionWrap(b), a.bounds())
 *         else:
 */
    __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_b); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 4007, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "bpf4/core.pyx":4008
 *             out = class_bin(a, b, _get_bounds(a, b))
 *         elif callable(b):
 *             out = class_bin(a, _FunctionWrap(b), a.bounds())             # <<<<<<<<<<<<<<
 *         else:
 *             out = class_const(a, b, a.bounds())
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_FunctionWrap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4008, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_b) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_b);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4008, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_bounds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4008, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4008, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_v_class_bin);
      __pyx_t_4 = __pyx_v_class_bin; __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_a, __pyx_t_5, __pyx_t_6};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4008, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_a, __pyx_t_5, __pyx_t_6};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4008, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4008, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_v_a);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_7, __pyx_t_6);
        __pyx_t_5 = 0;
        __pyx_t_6 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4008, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_out = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "bpf4/core.pyx":4007
 *         if isinstance(b, BpfInterface):
 *             out = class_bin(a, b, _get_bounds(a, b))
 *         elif callable(b):             # <<<<<<<<<<<<<<
 *             out = class_bin(a, _FunctionWrap(b), a.bounds())
 *         else:
 */
      goto __pyx_L4;
    }

    /* "bpf4/core.pyx":4010
 *             out = class_bin(a, _FunctionWrap(b), a.bounds())
 *         else:
 *             out = class_const(a, b, a.bounds())             # <<<<<<<<<<<<<<
 *         return out
 *     else:
 */
    /*else*/ {
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_bounds); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_INCREF(__pyx_v_class_const);
      __pyx_t_9 = __pyx_v_class_const; __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_9)) {
        PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_a, __pyx_v_b, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4010, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
        PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_a, __pyx_v_b, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4010, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4010, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_a);
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_b);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_7, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4010, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_out = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_L4:;

    /* "bpf4/core.pyx":4011
 *         else:
 *             out = class_const(a, b, a.bounds())
 *         return out             # <<<<<<<<<<<<<<
 *     else:
 *         if callable(a):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_out);
    __pyx_r = __pyx_v_out;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4004
 * 
 * cdef _create_rlambda(object a, object b, class_bin, class_const, class_rbin=None, class_rconst=None):
 *     if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *         if isinstance(b, BpfInterface):
 *             out = class_bin(a, b, _get_bounds(a, b))
 */
  }

  /* "bpf4/core.pyx":4013
 *         return out
 *     else:
 *         if callable(a):             # <<<<<<<<<<<<<<
 *             out = class_rbin(_FunctionWrap(a), b, b.bounds())
 *         else:
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_a); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4013, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":4014
 *     else:
 *         if callable(a):
 *             out = class_rbin(_FunctionWrap(a), b, b.bounds())             # <<<<<<<<<<<<<<
 *         else:
 *             out = class_rconst(b, a, b.bounds())
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FunctionWrap); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4014, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_9 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_a) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_a);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4014, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_bounds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4014, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4014, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_v_class_rbin);
      __pyx_t_4 = __pyx_v_class_rbin; __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_9, __pyx_v_b, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4014, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_9, __pyx_v_b, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4014, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4014, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_9);
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_b);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
        __pyx_t_9 = 0;
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4014, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_out = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "bpf4/core.pyx":4013
 *         return out
 *     else:
 *         if callable(a):             # <<<<<<<<<<<<<<
 *             out = class_rbin(_FunctionWrap(a), b, b.bounds())
 *         else:
 */
      goto __pyx_L5;
    }

    /* "bpf4/core.pyx":4016
 *             out = class_rbin(_FunctionWrap(a), b, b.bounds())
 *         else:
 *             out = class_rconst(b, a, b.bounds())             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
    /*else*/ {
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_bounds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4016, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4016, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_v_class_rconst);
      __pyx_t_8 = __pyx_v_class_rconst; __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_b, __pyx_v_a, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4016, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_b, __pyx_v_a, __pyx_t_4};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4016, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4016, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_b);
        __Pyx_GIVEREF(__pyx_v_b);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_v_b);
        __Pyx_INCREF(__pyx_v_a);
        __Pyx_GIVEREF(__pyx_v_a);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_v_a);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_7, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4016, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_out = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_L5:;
  }

  /* "bpf4/core.pyx":4017
 *         else:
 *             out = class_rconst(b, a, b.bounds())
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef class _BpfBinOp(BpfInterface):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4003
 *     return out
 * 
 * cdef _create_rlambda(object a, object b, class_bin, class_const, class_rbin=None, class_rconst=None):             # <<<<<<<<<<<<<<
 *     if isinstance(a, BpfInterface):
 *         if isinstance(b, BpfInterface):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bpf4.core._create_rlambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4025
 *     cdef BpfInterface a, b
 * 
 *     def __init__(self, BpfInterface a, BpfInterface b, tuple bounds):             # <<<<<<<<<<<<<<
 *         self.a = a
 *         self.b = b
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a = 0;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b = 0;
  PyObject *__pyx_v_bounds = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_bounds,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 4025, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 4025, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 4025, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
    __pyx_v_b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[1]);
    __pyx_v_bounds = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4025, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfBinOp.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "a", 0))) __PYX_ERR(0, 4025, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "b", 0))) __PYX_ERR(0, 4025, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bounds), (&PyTuple_Type), 1, "bounds", 1))) __PYX_ERR(0, 4025, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_9_BpfBinOp___init__(((struct __pyx_obj_4bpf4_4core__BpfBinOp *)__pyx_v_self), __pyx_v_a, __pyx_v_b, __pyx_v_bounds);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_9_BpfBinOp___init__(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b, PyObject *__pyx_v_bounds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  double __pyx_t_3;
  double __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":4026
 * 
 *     def __init__(self, BpfInterface a, BpfInterface b, tuple bounds):
 *         self.a = a             # <<<<<<<<<<<<<<
 *         self.b = b
 *         self._x0, self._x1 = bounds
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_a));
  __Pyx_GOTREF(__pyx_v_self->a);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->a));
  __pyx_v_self->a = __pyx_v_a;

  /* "bpf4/core.pyx":4027
 *     def __init__(self, BpfInterface a, BpfInterface b, tuple bounds):
 *         self.a = a
 *         self.b = b             # <<<<<<<<<<<<<<
 *         self._x0, self._x1 = bounds
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_b));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_b));
  __Pyx_GOTREF(__pyx_v_self->b);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->b));
  __pyx_v_self->b = __pyx_v_b;

  /* "bpf4/core.pyx":4028
 *         self.a = a
 *         self.b = b
 *         self._x0, self._x1 = bounds             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  if (likely(__pyx_v_bounds != Py_None)) {
    PyObject* sequence = __pyx_v_bounds;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 4028, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 4028, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4028, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4028, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->__pyx_base._x0 = __pyx_t_3;
  __pyx_v_self->__pyx_base._x1 = __pyx_t_4;

  /* "bpf4/core.pyx":4025
 *     cdef BpfInterface a, b
 * 
 *     def __init__(self, BpfInterface a, BpfInterface b, tuple bounds):             # <<<<<<<<<<<<<<
 *         self.a = a
 *         self.b = b
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core._BpfBinOp.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4030
 *         self._x0, self._x1 = bounds
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b, (self._x0, self._x1)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_9_BpfBinOp_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_9_BpfBinOp_2__getstate__[] = "_BpfBinOp.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_9_BpfBinOp_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_9_BpfBinOp_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_9_BpfBinOp_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_9_BpfBinOp_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_9_BpfBinOp_2__getstate__(((struct __pyx_obj_4bpf4_4core__BpfBinOp *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_9_BpfBinOp_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":4031
 * 
 *     def __getstate__(self):
 *         return self.a, self.b, (self._x0, self._x1)             # <<<<<<<<<<<<<<
 * 
 *     def _get_xs_for_rendering(self, int n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._x0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->a));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->a));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->b));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->b));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->b));
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4030
 *         self._x0, self._x1 = bounds
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b, (self._x0, self._x1)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfBinOp.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4033
 *         return self.a, self.b, (self._x0, self._x1)
 * 
 *     def _get_xs_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         return numpy.unique(numpy.append(self.a._get_xs_for_rendering(n), self.b._get_xs_for_rendering(n)))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_9_BpfBinOp_5_get_xs_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
static char __pyx_doc_4bpf4_4core_9_BpfBinOp_4_get_xs_for_rendering[] = "_BpfBinOp._get_xs_for_rendering(self, int n)";
static PyMethodDef __pyx_mdef_4bpf4_4core_9_BpfBinOp_5_get_xs_for_rendering = {"_get_xs_for_rendering", (PyCFunction)__pyx_pw_4bpf4_4core_9_BpfBinOp_5_get_xs_for_rendering, METH_O, __pyx_doc_4bpf4_4core_9_BpfBinOp_4_get_xs_for_rendering};
static PyObject *__pyx_pw_4bpf4_4core_9_BpfBinOp_5_get_xs_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
  int __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_xs_for_rendering (wrapper)", 0);
  assert(__pyx_arg_n); {
    __pyx_v_n = __Pyx_PyInt_As_int(__pyx_arg_n); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4033, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfBinOp._get_xs_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_9_BpfBinOp_4_get_xs_for_rendering(((struct __pyx_obj_4bpf4_4core__BpfBinOp *)__pyx_v_self), ((int)__pyx_v_n));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_9_BpfBinOp_4_get_xs_for_rendering(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, int __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_xs_for_rendering", 0);

  /* "bpf4/core.pyx":4034
 * 
 *     def _get_xs_for_rendering(self, int n):
 *         return numpy.unique(numpy.append(self.a._get_xs_for_rendering(n), self.b._get_xs_for_rendering(n)))             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_append); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->a), __pyx_n_s_get_xs_for_rendering); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->b), __pyx_n_s_get_xs_for_rendering); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  __pyx_t_10 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_10 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4034, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4034, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4034, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_10, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4034, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4033
 *         return self.a, self.b, (self._x0, self._x1)
 * 
 *     def _get_xs_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         return numpy.unique(numpy.append(self.a._get_xs_for_rendering(n), self.b._get_xs_for_rendering(n)))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bpf4.core._BpfBinOp._get_xs_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4036
 *         return numpy.unique(numpy.append(self.a._get_xs_for_rendering(n), self.b._get_xs_for_rendering(n)))
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double A = self.a.__ccall__(x)
 *         cdef double B = self.b.__ccall__(x)
 */

static double __pyx_f_4bpf4_4core_9_BpfBinOp___ccall__(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_A;
  double __pyx_v_B;
  double __pyx_r;

  /* "bpf4/core.pyx":4037
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double A = self.a.__ccall__(x)             # <<<<<<<<<<<<<<
 *         cdef double B = self.b.__ccall__(x)
 *         self._apply(&A, &B, 1)
 */
  __pyx_v_A = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->a, __pyx_v_x);

  /* "bpf4/core.pyx":4038
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double A = self.a.__ccall__(x)
 *         cdef double B = self.b.__ccall__(x)             # <<<<<<<<<<<<<<
 *         self._apply(&A, &B, 1)
 *         return A
 */
  __pyx_v_B = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->b->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->b, __pyx_v_x);

  /* "bpf4/core.pyx":4039
 *         cdef double A = self.a.__ccall__(x)
 *         cdef double B = self.b.__ccall__(x)
 *         self._apply(&A, &B, 1)             # <<<<<<<<<<<<<<
 *         return A
 * 
 */
  ((struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp *)__pyx_v_self->__pyx_base.__pyx_vtab)->_apply(__pyx_v_self, (&__pyx_v_A), (&__pyx_v_B), 1);

  /* "bpf4/core.pyx":4040
 *         cdef double B = self.b.__ccall__(x)
 *         self._apply(&A, &B, 1)
 *         return A             # <<<<<<<<<<<<<<
 * 
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 */
  __pyx_r = __pyx_v_A;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4036
 *         return numpy.unique(numpy.append(self.a._get_xs_for_rendering(n), self.b._get_xs_for_rendering(n)))
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double A = self.a.__ccall__(x)
 *         cdef double B = self.b.__ccall__(x)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4042
 *         return A
 * 
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         # the result should be put in A
 *         pass
 */

static void __pyx_f_4bpf4_4core_9_BpfBinOp__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, CYTHON_UNUSED __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, CYTHON_UNUSED __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, CYTHON_UNUSED int __pyx_v_n) {

  /* function exit code */
}

/* "bpf4/core.pyx":4046
 *         pass
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = <ndarray>out if out is not None else EMPTY1D(n)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(n)
 */

static PyObject *__pyx_pw_4bpf4_4core_9_BpfBinOp_7mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_9_BpfBinOp_mapn_between(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_9_BpfBinOp_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  PyArrayObject *__pyx_v_A = 0;
  PyArrayObject *__pyx_v_B = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
  __Pyx_Buffer __pyx_pybuffer_A;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_B;
  __Pyx_Buffer __pyx_pybuffer_B;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  __pyx_pybuffer_A.pybuffer.buf = NULL;
  __pyx_pybuffer_A.refcount = 0;
  __pyx_pybuffernd_A.data = NULL;
  __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
  __pyx_pybuffer_B.pybuffer.buf = NULL;
  __pyx_pybuffer_B.refcount = 0;
  __pyx_pybuffernd_B.data = NULL;
  __pyx_pybuffernd_B.rcbuffer = &__pyx_pybuffer_B;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4046, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_9_BpfBinOp_7mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4046, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4046, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4046, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4046, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4046, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4046, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4046, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4046, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4047
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = <ndarray>out if out is not None else EMPTY1D(n)             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(n)
 *         self.a.mapn_between(n, x0, x1, A)
 */
  __pyx_t_10 = (((PyObject *)__pyx_v_out) != Py_None);
  if ((__pyx_t_10 != 0)) {
    __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_out)));
    __pyx_t_1 = ((PyObject *)__pyx_v_out);
  } else {
    __pyx_t_2 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_A = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_A.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4047, __pyx_L1_error)
    } else {__pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_A = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4048
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = <ndarray>out if out is not None else EMPTY1D(n)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(n)             # <<<<<<<<<<<<<<
 *         self.a.mapn_between(n, x0, x1, A)
 *         self.b.mapn_between(n, x0, x1, B)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_B.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_B = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_B.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4048, __pyx_L1_error)
    } else {__pyx_pybuffernd_B.diminfo[0].strides = __pyx_pybuffernd_B.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_B.diminfo[0].shape = __pyx_pybuffernd_B.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_B = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4049
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = <ndarray>out if out is not None else EMPTY1D(n)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(n)
 *         self.a.mapn_between(n, x0, x1, A)             # <<<<<<<<<<<<<<
 *         self.b.mapn_between(n, x0, x1, B)
 *         #cdef c_numpy.ndarray[DTYPE_t, ndim=1] ys_a = self.a.mapn_between(n, x0, x1, out)
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.out = ((PyArrayObject *)__pyx_v_A);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->mapn_between(__pyx_v_self->a, __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4050
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(n)
 *         self.a.mapn_between(n, x0, x1, A)
 *         self.b.mapn_between(n, x0, x1, B)             # <<<<<<<<<<<<<<
 *         #cdef c_numpy.ndarray[DTYPE_t, ndim=1] ys_a = self.a.mapn_between(n, x0, x1, out)
 *         #cdef c_numpy.ndarray[DTYPE_t, ndim=1] ys_b = self.b.mapn_between(n, x0, x1)
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.out = ((PyArrayObject *)__pyx_v_B);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->b->__pyx_vtab)->mapn_between(__pyx_v_self->b, __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4053
 *         #cdef c_numpy.ndarray[DTYPE_t, ndim=1] ys_a = self.a.mapn_between(n, x0, x1, out)
 *         #cdef c_numpy.ndarray[DTYPE_t, ndim=1] ys_b = self.b.mapn_between(n, x0, x1)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self._apply(<DTYPE_t*>A.data, <DTYPE_t*>B.data, n)
 *             # self._apply(&A[0], &B[0], n)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "bpf4/core.pyx":4054
 *         #cdef c_numpy.ndarray[DTYPE_t, ndim=1] ys_b = self.b.mapn_between(n, x0, x1)
 *         with nogil:
 *             self._apply(<DTYPE_t*>A.data, <DTYPE_t*>B.data, n)             # <<<<<<<<<<<<<<
 *             # self._apply(&A[0], &B[0], n)
 *         return A
 */
        ((struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp *)__pyx_v_self->__pyx_base.__pyx_vtab)->_apply(__pyx_v_self, ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_A->data), ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_B->data), __pyx_v_n);
      }

      /* "bpf4/core.pyx":4053
 *         #cdef c_numpy.ndarray[DTYPE_t, ndim=1] ys_a = self.a.mapn_between(n, x0, x1, out)
 *         #cdef c_numpy.ndarray[DTYPE_t, ndim=1] ys_b = self.b.mapn_between(n, x0, x1)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self._apply(<DTYPE_t*>A.data, <DTYPE_t*>B.data, n)
 *             # self._apply(&A[0], &B[0], n)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "bpf4/core.pyx":4056
 *             self._apply(<DTYPE_t*>A.data, <DTYPE_t*>B.data, n)
 *             # self._apply(&A[0], &B[0], n)
 *         return A             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_A));
  __pyx_r = ((PyArrayObject *)__pyx_v_A);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4046
 *         pass
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = <ndarray>out if out is not None else EMPTY1D(n)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(n)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_B.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core._BpfBinOp.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_B.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_A);
  __Pyx_XDECREF((PyObject *)__pyx_v_B);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_9_BpfBinOp_7mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_9_BpfBinOp_6mapn_between[] = "_BpfBinOp.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray";
static PyMethodDef __pyx_mdef_4bpf4_4core_9_BpfBinOp_7mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_9_BpfBinOp_7mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_9_BpfBinOp_6mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_9_BpfBinOp_7mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 4046, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 4046, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 4046, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4046, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4046, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4046, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4046, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfBinOp.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 4046, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_9_BpfBinOp_6mapn_between(((struct __pyx_obj_4bpf4_4core__BpfBinOp *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_9_BpfBinOp_6mapn_between(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__BpfBinOp->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfBinOp.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4058
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */

static PyObject *__pyx_pw_4bpf4_4core_9_BpfBinOp_9map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_9_BpfBinOp_map(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_9_BpfBinOp_map *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  int __pyx_v_len_xs;
  PyArrayObject *__pyx_v_A = 0;
  PyArrayObject *__pyx_v_B = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
  __Pyx_Buffer __pyx_pybuffer_A;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_B;
  __Pyx_Buffer __pyx_pybuffer_B;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  __pyx_pybuffer_A.pybuffer.buf = NULL;
  __pyx_pybuffer_A.refcount = 0;
  __pyx_pybuffernd_A.data = NULL;
  __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
  __pyx_pybuffer_B.pybuffer.buf = NULL;
  __pyx_pybuffer_B.refcount = 0;
  __pyx_pybuffernd_B.data = NULL;
  __pyx_pybuffernd_B.rcbuffer = &__pyx_pybuffer_B;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4058, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_9_BpfBinOp_9map)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4058, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4058, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4058, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(__pyx_v_xs);
          __Pyx_GIVEREF(__pyx_v_xs);
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_xs);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_out));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4058, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4058, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4069
 *         """
 *         cdef int len_xs
 *         if isinstance(xs, (int, long)):             # <<<<<<<<<<<<<<
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         len_xs = len(xs)
 */
  __pyx_t_8 = PyInt_Check(__pyx_v_xs); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (!__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = PyLong_Check(__pyx_v_xs); 
  __pyx_t_8 = (__pyx_t_9 != 0);
  __pyx_t_7 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "bpf4/core.pyx":4070
 *         cdef int len_xs
 *         if isinstance(xs, (int, long)):
 *             return self.mapn_between(xs, self._x0, self._x1, out)             # <<<<<<<<<<<<<<
 *         len_xs = len(xs)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = out if out is not None else EMPTY1D(len_xs)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_xs); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4070, __pyx_L1_error)
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.out = __pyx_v_out;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_t_5, __pyx_v_self->__pyx_base._x0, __pyx_v_self->__pyx_base._x1, 0, &__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4069
 *         """
 *         cdef int len_xs
 *         if isinstance(xs, (int, long)):             # <<<<<<<<<<<<<<
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         len_xs = len(xs)
 */
  }

  /* "bpf4/core.pyx":4071
 *         if isinstance(xs, (int, long)):
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         len_xs = len(xs)             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = out if out is not None else EMPTY1D(len_xs)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(len_xs)
 */
  __pyx_t_11 = PyObject_Length(__pyx_v_xs); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4071, __pyx_L1_error)
  __pyx_v_len_xs = __pyx_t_11;

  /* "bpf4/core.pyx":4072
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         len_xs = len(xs)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = out if out is not None else EMPTY1D(len_xs)             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(len_xs)
 *         self.a.map(xs, A)
 */
  __pyx_t_8 = (((PyObject *)__pyx_v_out) != Py_None);
  if ((__pyx_t_8 != 0)) {
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = ((PyObject *)__pyx_v_out);
  } else {
    __pyx_t_2 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_len_xs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_A = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_A.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4072, __pyx_L1_error)
    } else {__pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_A = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4073
 *         len_xs = len(xs)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = out if out is not None else EMPTY1D(len_xs)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(len_xs)             # <<<<<<<<<<<<<<
 *         self.a.map(xs, A)
 *         self.b.map(xs, B)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_len_xs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_B.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_B = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_B.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4073, __pyx_L1_error)
    } else {__pyx_pybuffernd_B.diminfo[0].strides = __pyx_pybuffernd_B.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_B.diminfo[0].shape = __pyx_pybuffernd_B.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_B = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4074
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = out if out is not None else EMPTY1D(len_xs)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(len_xs)
 *         self.a.map(xs, A)             # <<<<<<<<<<<<<<
 *         self.b.map(xs, B)
 *         with nogil:
 */
  __pyx_t_12.__pyx_n = 1;
  __pyx_t_12.out = ((PyArrayObject *)__pyx_v_A);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->map(__pyx_v_self->a, __pyx_v_xs, 0, &__pyx_t_12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4075
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(len_xs)
 *         self.a.map(xs, A)
 *         self.b.map(xs, B)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self._apply(<DTYPE_t *>(A.data), <DTYPE_t *>(B.data), len_xs)
 */
  __pyx_t_12.__pyx_n = 1;
  __pyx_t_12.out = ((PyArrayObject *)__pyx_v_B);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->b->__pyx_vtab)->map(__pyx_v_self->b, __pyx_v_xs, 0, &__pyx_t_12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4076
 *         self.a.map(xs, A)
 *         self.b.map(xs, B)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self._apply(<DTYPE_t *>(A.data), <DTYPE_t *>(B.data), len_xs)
 *         return numpy.asarray(A)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "bpf4/core.pyx":4077
 *         self.b.map(xs, B)
 *         with nogil:
 *             self._apply(<DTYPE_t *>(A.data), <DTYPE_t *>(B.data), len_xs)             # <<<<<<<<<<<<<<
 *         return numpy.asarray(A)
 * 
 */
        ((struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp *)__pyx_v_self->__pyx_base.__pyx_vtab)->_apply(__pyx_v_self, ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_A->data), ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_B->data), __pyx_v_len_xs);
      }

      /* "bpf4/core.pyx":4076
 *         self.a.map(xs, A)
 *         self.b.map(xs, B)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self._apply(<DTYPE_t *>(A.data), <DTYPE_t *>(B.data), len_xs)
 *         return numpy.asarray(A)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L8:;
      }
  }

  /* "bpf4/core.pyx":4078
 *         with nogil:
 *             self._apply(<DTYPE_t *>(A.data), <DTYPE_t *>(B.data), len_xs)
 *         return numpy.asarray(A)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_A)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_A));
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4078, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4058
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_B.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core._BpfBinOp.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_B.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_A);
  __Pyx_XDECREF((PyObject *)__pyx_v_B);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_9_BpfBinOp_9map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_9_BpfBinOp_8map[] = "_BpfBinOp.map(self, xs, ndarray out=None) -> ndarray\n\n        the same as map(self, xs) but somewhat faster\n\n        xs can also be a number, in which case it is interpreted as\n        the number of elements to calculate in an evenly spaced\n        grid between the bounds of this bpf.\n        bpf.map(10) == bpf.map(numpy.linspace(x0, x1, 10))\n        ( this is the same as bpf.mapn_between(10, bpf.x0, bpf.x1) )\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_9_BpfBinOp_9map = {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_9_BpfBinOp_9map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_9_BpfBinOp_8map};
static PyObject *__pyx_pw_4bpf4_4core_9_BpfBinOp_9map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_out,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 4058, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_out = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4058, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfBinOp.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 4058, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_9_BpfBinOp_8map(((struct __pyx_obj_4bpf4_4core__BpfBinOp *)__pyx_v_self), __pyx_v_xs, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_9_BpfBinOp_8map(struct __pyx_obj_4bpf4_4core__BpfBinOp *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__BpfBinOp->__pyx_base.map(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_xs, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfBinOp.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4086
 *     cdef int funcindex
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), (), self.a, self.funcindex
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_13_BpfUnaryFunc___reduce__[] = "_BpfUnaryFunc.__reduce__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_13_BpfUnaryFunc_1__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_1__reduce__, METH_NOARGS, __pyx_doc_4bpf4_4core_13_BpfUnaryFunc___reduce__};
static PyObject *__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfUnaryFunc___reduce__(((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_BpfUnaryFunc___reduce__(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "bpf4/core.pyx":4087
 * 
 *     def __reduce__(self):
 *         return type(self), (), self.a, self.funcindex             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->funcindex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __Pyx_INCREF(__pyx_empty_tuple);
  __Pyx_GIVEREF(__pyx_empty_tuple);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_empty_tuple);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->a));
  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_self->a));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4086
 *     cdef int funcindex
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), (), self.a, self.funcindex
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core._BpfUnaryFunc.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4089
 *         return type(self), (), self.a, self.funcindex
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         bpf, funcindex = state
 *         return _BpfUnaryFunc_new_from_index(bpf, funcindex)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_3__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_4bpf4_4core_13_BpfUnaryFunc_2__setstate__[] = "_BpfUnaryFunc.__setstate__(self, state)";
static PyMethodDef __pyx_mdef_4bpf4_4core_13_BpfUnaryFunc_3__setstate__ = {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_3__setstate__, METH_O, __pyx_doc_4bpf4_4core_13_BpfUnaryFunc_2__setstate__};
static PyObject *__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_3__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfUnaryFunc_2__setstate__(((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_BpfUnaryFunc_2__setstate__(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_v_bpf = NULL;
  PyObject *__pyx_v_funcindex = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "bpf4/core.pyx":4090
 * 
 *     def __setstate__(self, state):
 *         bpf, funcindex = state             # <<<<<<<<<<<<<<
 *         return _BpfUnaryFunc_new_from_index(bpf, funcindex)
 * 
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_state))) || (PyList_CheckExact(__pyx_v_state))) {
    PyObject* sequence = __pyx_v_state;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 4090, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 4090, __pyx_L1_error)
    __pyx_t_4 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 4090, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_bpf = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_funcindex = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":4091
 *     def __setstate__(self, state):
 *         bpf, funcindex = state
 *         return _BpfUnaryFunc_new_from_index(bpf, funcindex)             # <<<<<<<<<<<<<<
 * 
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(((__pyx_v_bpf) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_bpf, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 4091, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_funcindex); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4091, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_bpf), __pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4089
 *         return type(self), (), self.a, self.funcindex
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         bpf, funcindex = state
 *         return _BpfUnaryFunc_new_from_index(bpf, funcindex)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfUnaryFunc.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bpf);
  __Pyx_XDECREF(__pyx_v_funcindex);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4093
 *         return _BpfUnaryFunc_new_from_index(bpf, funcindex)
 * 
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         cdef t_unfunc func = self.func
 *         for i in range(n):
 */

static void __pyx_f_4bpf4_4core_13_BpfUnaryFunc__apply(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n) {
  __pyx_t_4bpf4_4core_t_unfunc __pyx_v_func;
  int __pyx_v_i;
  __pyx_t_4bpf4_4core_t_unfunc __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":4094
 * 
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         cdef t_unfunc func = self.func             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = func(A[i])
 */
  __pyx_t_1 = __pyx_v_self->func;
  __pyx_v_func = __pyx_t_1;

  /* "bpf4/core.pyx":4095
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         cdef t_unfunc func = self.func
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = func(A[i])
 * 
 */
  __pyx_t_2 = __pyx_v_n;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "bpf4/core.pyx":4096
 *         cdef t_unfunc func = self.func
 *         for i in range(n):
 *             A[i] = func(A[i])             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
    (__pyx_v_A[__pyx_v_i]) = __pyx_v_func((__pyx_v_A[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4093
 *         return _BpfUnaryFunc_new_from_index(bpf, funcindex)
 * 
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         cdef t_unfunc func = self.func
 *         for i in range(n):
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4098
 *             A[i] = func(A[i])
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         return self.func(self.a.__ccall__(x))
 * 
 */

static double __pyx_f_4bpf4_4core_13_BpfUnaryFunc___ccall__(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, double __pyx_v_x) {
  double __pyx_r;

  /* "bpf4/core.pyx":4099
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         return self.func(self.a.__ccall__(x))             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 */
  __pyx_r = __pyx_v_self->func(((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->a, __pyx_v_x));
  goto __pyx_L0;

  /* "bpf4/core.pyx":4098
 *             A[i] = func(A[i])
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         return self.func(self.a.__ccall__(x))
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4101
 *         return self.func(self.a.__ccall__(x))
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         cdef t_unfunc func = self.func
 */

static PyObject *__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_5mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_13_BpfUnaryFunc_mapn_between(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_13_BpfUnaryFunc_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  PyArrayObject *__pyx_v_A = 0;
  CYTHON_UNUSED __pyx_t_4bpf4_4core_t_unfunc __pyx_v_func;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
  __Pyx_Buffer __pyx_pybuffer_A;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_10;
  __pyx_t_4bpf4_4core_t_unfunc __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  __pyx_pybuffer_A.pybuffer.buf = NULL;
  __pyx_pybuffer_A.refcount = 0;
  __pyx_pybuffernd_A.data = NULL;
  __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4101, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_5mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4101, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4101, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4101, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4101, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4101, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4101, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4101, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4101, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4102
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)             # <<<<<<<<<<<<<<
 *         cdef t_unfunc func = self.func
 *         with nogil:
 */
  __pyx_t_10.__pyx_n = 1;
  __pyx_t_10.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->mapn_between(__pyx_v_self->a, __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_A = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_A.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4102, __pyx_L1_error)
    } else {__pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_A = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4103
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         cdef t_unfunc func = self.func             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self._apply(<DTYPE_t *>(A.data), n)
 */
  __pyx_t_11 = __pyx_v_self->func;
  __pyx_v_func = __pyx_t_11;

  /* "bpf4/core.pyx":4104
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         cdef t_unfunc func = self.func
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self._apply(<DTYPE_t *>(A.data), n)
 *         return A
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "bpf4/core.pyx":4105
 *         cdef t_unfunc func = self.func
 *         with nogil:
 *             self._apply(<DTYPE_t *>(A.data), n)             # <<<<<<<<<<<<<<
 *         return A
 * 
 */
        ((struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryFunc *)__pyx_v_self->__pyx_base.__pyx_vtab)->_apply(__pyx_v_self, ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_A->data), __pyx_v_n);
      }

      /* "bpf4/core.pyx":4104
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         cdef t_unfunc func = self.func
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self._apply(<DTYPE_t *>(A.data), n)
 *         return A
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "bpf4/core.pyx":4106
 *         with nogil:
 *             self._apply(<DTYPE_t *>(A.data), n)
 *         return A             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_A));
  __pyx_r = ((PyArrayObject *)__pyx_v_A);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4101
 *         return self.func(self.a.__ccall__(x))
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         cdef t_unfunc func = self.func
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core._BpfUnaryFunc.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_A);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_5mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_13_BpfUnaryFunc_4mapn_between[] = "_BpfUnaryFunc.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray";
static PyMethodDef __pyx_mdef_4bpf4_4core_13_BpfUnaryFunc_5mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_5mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_13_BpfUnaryFunc_4mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_5mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 4101, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 4101, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 4101, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4101, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4101, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4101, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4101, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfUnaryFunc.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 4101, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfUnaryFunc_4mapn_between(((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_BpfUnaryFunc_4mapn_between(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__BpfUnaryFunc->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfUnaryFunc.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4108
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */

static PyObject *__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_7map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_13_BpfUnaryFunc_map(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_13_BpfUnaryFunc_map *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  PyArrayObject *__pyx_v_A = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
  __Pyx_Buffer __pyx_pybuffer_A;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  __pyx_pybuffer_A.pybuffer.buf = NULL;
  __pyx_pybuffer_A.refcount = 0;
  __pyx_pybuffernd_A.data = NULL;
  __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_7map)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4108, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4108, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4108, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(__pyx_v_xs);
          __Pyx_GIVEREF(__pyx_v_xs);
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_xs);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_out));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4108, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4108, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4119
 *         """
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A
 *         if isinstance(xs, (int, long)):             # <<<<<<<<<<<<<<
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         A = self.a.map(xs, out)
 */
  __pyx_t_8 = PyInt_Check(__pyx_v_xs); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (!__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = PyLong_Check(__pyx_v_xs); 
  __pyx_t_8 = (__pyx_t_9 != 0);
  __pyx_t_7 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "bpf4/core.pyx":4120
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A
 *         if isinstance(xs, (int, long)):
 *             return self.mapn_between(xs, self._x0, self._x1, out)             # <<<<<<<<<<<<<<
 *         A = self.a.map(xs, out)
 *         self._apply(<DTYPE_t *>(A.data), len(xs))
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_xs); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4120, __pyx_L1_error)
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.out = __pyx_v_out;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryFunc *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_t_5, __pyx_v_self->__pyx_base._x0, __pyx_v_self->__pyx_base._x1, 0, &__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4119
 *         """
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A
 *         if isinstance(xs, (int, long)):             # <<<<<<<<<<<<<<
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         A = self.a.map(xs, out)
 */
  }

  /* "bpf4/core.pyx":4121
 *         if isinstance(xs, (int, long)):
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         A = self.a.map(xs, out)             # <<<<<<<<<<<<<<
 *         self._apply(<DTYPE_t *>(A.data), len(xs))
 *         return A
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->map(__pyx_v_self->a, __pyx_v_xs, 0, &__pyx_t_11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      }
      __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0;
    }
    __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4121, __pyx_L1_error)
  }
  __pyx_v_A = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4122
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         A = self.a.map(xs, out)
 *         self._apply(<DTYPE_t *>(A.data), len(xs))             # <<<<<<<<<<<<<<
 *         return A
 * 
 */
  __pyx_t_15 = PyObject_Length(__pyx_v_xs); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4122, __pyx_L1_error)
  ((struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryFunc *)__pyx_v_self->__pyx_base.__pyx_vtab)->_apply(__pyx_v_self, ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_A->data), __pyx_t_15);

  /* "bpf4/core.pyx":4123
 *         A = self.a.map(xs, out)
 *         self._apply(<DTYPE_t *>(A.data), len(xs))
 *         return A             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_A));
  __pyx_r = ((PyArrayObject *)__pyx_v_A);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4108
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core._BpfUnaryFunc.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_A);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_7map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_13_BpfUnaryFunc_6map[] = "_BpfUnaryFunc.map(self, xs, ndarray out=None) -> ndarray\n\n        the same as map(self, xs) but somewhat faster\n\n        xs can also be a number, in which case it is interpreted as\n        the number of elements to calculate in an evenly spaced\n        grid between the bounds of this bpf.\n        bpf.map(10) == bpf.map(numpy.linspace(x0, x1, 10))\n        ( this is the same as bpf.mapn_between(10, bpf.x0, bpf.x1) )\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_13_BpfUnaryFunc_7map = {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_7map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_13_BpfUnaryFunc_6map};
static PyObject *__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_7map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_out,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 4108, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_out = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4108, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfUnaryFunc.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 4108, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfUnaryFunc_6map(((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_v_self), __pyx_v_xs, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_BpfUnaryFunc_6map(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__BpfUnaryFunc->__pyx_base.map(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_xs, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfUnaryFunc.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4126
 * 
 * 
 * cdef _BpfUnaryFunc _BpfUnaryFunc_new(BpfInterface a, t_unfunc func, int funcindex):             # <<<<<<<<<<<<<<
 *     cdef _BpfUnaryFunc self = _BpfUnaryFunc()
 *     self.a = a
 */

static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core__BpfUnaryFunc_new(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, __pyx_t_4bpf4_4core_t_unfunc __pyx_v_func, int __pyx_v_funcindex) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_v_self = 0;
  double __pyx_v_x0;
  double __pyx_v_x1;
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  double __pyx_t_6;
  double __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_BpfUnaryFunc_new", 0);

  /* "bpf4/core.pyx":4127
 * 
 * cdef _BpfUnaryFunc _BpfUnaryFunc_new(BpfInterface a, t_unfunc func, int funcindex):
 *     cdef _BpfUnaryFunc self = _BpfUnaryFunc()             # <<<<<<<<<<<<<<
 *     self.a = a
 *     self.func = func
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfUnaryFunc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_self = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4128
 * cdef _BpfUnaryFunc _BpfUnaryFunc_new(BpfInterface a, t_unfunc func, int funcindex):
 *     cdef _BpfUnaryFunc self = _BpfUnaryFunc()
 *     self.a = a             # <<<<<<<<<<<<<<
 *     self.func = func
 *     self.funcindex = funcindex
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_a));
  __Pyx_GOTREF(__pyx_v_self->a);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->a));
  __pyx_v_self->a = __pyx_v_a;

  /* "bpf4/core.pyx":4129
 *     cdef _BpfUnaryFunc self = _BpfUnaryFunc()
 *     self.a = a
 *     self.func = func             # <<<<<<<<<<<<<<
 *     self.funcindex = funcindex
 *     cdef double x0, x1
 */
  __pyx_v_self->func = __pyx_v_func;

  /* "bpf4/core.pyx":4130
 *     self.a = a
 *     self.func = func
 *     self.funcindex = funcindex             # <<<<<<<<<<<<<<
 *     cdef double x0, x1
 *     x0, x1 = a.bounds()
 */
  __pyx_v_self->funcindex = __pyx_v_funcindex;

  /* "bpf4/core.pyx":4132
 *     self.funcindex = funcindex
 *     cdef double x0, x1
 *     x0, x1 = a.bounds()             # <<<<<<<<<<<<<<
 *     self._set_bounds(x0, x1)
 *     return self
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_bounds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 4132, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 4132, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 4132, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_x0 = __pyx_t_6;
  __pyx_v_x1 = __pyx_t_7;

  /* "bpf4/core.pyx":4133
 *     cdef double x0, x1
 *     x0, x1 = a.bounds()
 *     self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":4134
 *     x0, x1 = a.bounds()
 *     self._set_bounds(x0, x1)
 *     return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4126
 * 
 * 
 * cdef _BpfUnaryFunc _BpfUnaryFunc_new(BpfInterface a, t_unfunc func, int funcindex):             # <<<<<<<<<<<<<<
 *     cdef _BpfUnaryFunc self = _BpfUnaryFunc()
 *     self.a = a
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfUnaryFunc_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4137
 * 
 * 
 * cdef _BpfUnaryFunc _BpfUnaryFunc_new_from_index (BpfInterface a, int funcindex):             # <<<<<<<<<<<<<<
 *     cdef t_unfunc func = _unfunc_from_index(funcindex)
 *     return _BpfUnaryFunc_new(a, func, funcindex)
 */

static struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_f_4bpf4_4core__BpfUnaryFunc_new_from_index(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, int __pyx_v_funcindex) {
  __pyx_t_4bpf4_4core_t_unfunc __pyx_v_func;
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_BpfUnaryFunc_new_from_index", 0);

  /* "bpf4/core.pyx":4138
 * 
 * cdef _BpfUnaryFunc _BpfUnaryFunc_new_from_index (BpfInterface a, int funcindex):
 *     cdef t_unfunc func = _unfunc_from_index(funcindex)             # <<<<<<<<<<<<<<
 *     return _BpfUnaryFunc_new(a, func, funcindex)
 * 
 */
  __pyx_v_func = __pyx_f_4bpf4_4core__unfunc_from_index(__pyx_v_funcindex);

  /* "bpf4/core.pyx":4139
 * cdef _BpfUnaryFunc _BpfUnaryFunc_new_from_index (BpfInterface a, int funcindex):
 *     cdef t_unfunc func = _unfunc_from_index(funcindex)
 *     return _BpfUnaryFunc_new(a, func, funcindex)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfUnaryFunc_new(__pyx_v_a, __pyx_v_func, __pyx_v_funcindex)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4137
 * 
 * 
 * cdef _BpfUnaryFunc _BpfUnaryFunc_new_from_index (BpfInterface a, int funcindex):             # <<<<<<<<<<<<<<
 *     cdef t_unfunc func = _unfunc_from_index(funcindex)
 *     return _BpfUnaryFunc_new(a, func, funcindex)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfUnaryFunc_new_from_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4142
 * 
 * 
 * cdef t_unfunc _unfunc_from_index(int funcindex):             # <<<<<<<<<<<<<<
 *     return UNFUNCS [funcindex]
 * 
 */

static __pyx_t_4bpf4_4core_t_unfunc __pyx_f_4bpf4_4core__unfunc_from_index(int __pyx_v_funcindex) {
  __pyx_t_4bpf4_4core_t_unfunc __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_unfunc_from_index", 0);

  /* "bpf4/core.pyx":4143
 * 
 * cdef t_unfunc _unfunc_from_index(int funcindex):
 *     return UNFUNCS [funcindex]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_4bpf4_4core_UNFUNCS[__pyx_v_funcindex]);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4142
 * 
 * 
 * cdef t_unfunc _unfunc_from_index(int funcindex):             # <<<<<<<<<<<<<<
 *     return UNFUNCS [funcindex]
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4152
 *     cdef BpfInterface a
 * 
 *     def __init__(self, BpfInterface a):             # <<<<<<<<<<<<<<
 *         self.a = a
 *         cdef double x0, x1
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_11_BpfUnaryOp_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_11_BpfUnaryOp_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 4152, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4152, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfUnaryOp.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "a", 0))) __PYX_ERR(0, 4152, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_11_BpfUnaryOp___init__(((struct __pyx_obj_4bpf4_4core__BpfUnaryOp *)__pyx_v_self), __pyx_v_a);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_11_BpfUnaryOp___init__(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  double __pyx_t_6;
  double __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":4153
 * 
 *     def __init__(self, BpfInterface a):
 *         self.a = a             # <<<<<<<<<<<<<<
 *         cdef double x0, x1
 *         x0, x1 = a.bounds()
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_a));
  __Pyx_GOTREF(__pyx_v_self->a);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->a));
  __pyx_v_self->a = __pyx_v_a;

  /* "bpf4/core.pyx":4155
 *         self.a = a
 *         cdef double x0, x1
 *         x0, x1 = a.bounds()             # <<<<<<<<<<<<<<
 *         self._set_bounds(x0, x1)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_bounds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 4155, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 4155, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 4155, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_x0 = __pyx_t_6;
  __pyx_v_x1 = __pyx_t_7;

  /* "bpf4/core.pyx":4156
 *         cdef double x0, x1
 *         x0, x1 = a.bounds()
 *         self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":4152
 *     cdef BpfInterface a
 * 
 *     def __init__(self, BpfInterface a):             # <<<<<<<<<<<<<<
 *         self.a = a
 *         cdef double x0, x1
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfUnaryOp.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4158
 *         self._set_bounds(x0, x1)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double X = self.a.__ccall__(x)
 *         self._apply(&X, 1)
 */

static double __pyx_f_4bpf4_4core_11_BpfUnaryOp___ccall__(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_X;
  double __pyx_r;

  /* "bpf4/core.pyx":4159
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double X = self.a.__ccall__(x)             # <<<<<<<<<<<<<<
 *         self._apply(&X, 1)
 *         return X
 */
  __pyx_v_X = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->a, __pyx_v_x);

  /* "bpf4/core.pyx":4160
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double X = self.a.__ccall__(x)
 *         self._apply(&X, 1)             # <<<<<<<<<<<<<<
 *         return X
 * 
 */
  ((struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp *)__pyx_v_self->__pyx_base.__pyx_vtab)->_apply(__pyx_v_self, (&__pyx_v_X), 1);

  /* "bpf4/core.pyx":4161
 *         cdef double X = self.a.__ccall__(x)
 *         self._apply(&X, 1)
 *         return X             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_r = __pyx_v_X;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4158
 *         self._set_bounds(x0, x1)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double X = self.a.__ccall__(x)
 *         self._apply(&X, 1)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4163
 *         return X
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.a,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_11_BpfUnaryOp_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_11_BpfUnaryOp_2__getstate__[] = "_BpfUnaryOp.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_11_BpfUnaryOp_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_11_BpfUnaryOp_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_11_BpfUnaryOp_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_11_BpfUnaryOp_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_11_BpfUnaryOp_2__getstate__(((struct __pyx_obj_4bpf4_4core__BpfUnaryOp *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_11_BpfUnaryOp_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":4164
 * 
 *     def __getstate__(self):
 *         return (self.a,)             # <<<<<<<<<<<<<<
 * 
 *     def _get_xs_for_rendering(self, int n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->a));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->a));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4163
 *         return X
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.a,)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfUnaryOp.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4166
 *         return (self.a,)
 * 
 *     def _get_xs_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         return self.a._get_xs_for_rendering(n)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_11_BpfUnaryOp_5_get_xs_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
static char __pyx_doc_4bpf4_4core_11_BpfUnaryOp_4_get_xs_for_rendering[] = "_BpfUnaryOp._get_xs_for_rendering(self, int n)";
static PyMethodDef __pyx_mdef_4bpf4_4core_11_BpfUnaryOp_5_get_xs_for_rendering = {"_get_xs_for_rendering", (PyCFunction)__pyx_pw_4bpf4_4core_11_BpfUnaryOp_5_get_xs_for_rendering, METH_O, __pyx_doc_4bpf4_4core_11_BpfUnaryOp_4_get_xs_for_rendering};
static PyObject *__pyx_pw_4bpf4_4core_11_BpfUnaryOp_5_get_xs_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
  int __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_xs_for_rendering (wrapper)", 0);
  assert(__pyx_arg_n); {
    __pyx_v_n = __Pyx_PyInt_As_int(__pyx_arg_n); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4166, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfUnaryOp._get_xs_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_11_BpfUnaryOp_4_get_xs_for_rendering(((struct __pyx_obj_4bpf4_4core__BpfUnaryOp *)__pyx_v_self), ((int)__pyx_v_n));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_11_BpfUnaryOp_4_get_xs_for_rendering(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, int __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_xs_for_rendering", 0);

  /* "bpf4/core.pyx":4167
 * 
 *     def _get_xs_for_rendering(self, int n):
 *         return self.a._get_xs_for_rendering(n)             # <<<<<<<<<<<<<<
 * 
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->a), __pyx_n_s_get_xs_for_rendering); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4166
 *         return (self.a,)
 * 
 *     def _get_xs_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         return self.a._get_xs_for_rendering(n)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfUnaryOp._get_xs_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4169
 *         return self.a._get_xs_for_rendering(n)
 * 
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static void __pyx_f_4bpf4_4core_11_BpfUnaryOp__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, CYTHON_UNUSED __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, CYTHON_UNUSED int __pyx_v_n) {

  /* function exit code */
}

/* "bpf4/core.pyx":4172
 *         pass
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         with nogil:
 */

static PyObject *__pyx_pw_4bpf4_4core_11_BpfUnaryOp_7mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_11_BpfUnaryOp_mapn_between(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_11_BpfUnaryOp_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  PyArrayObject *__pyx_v_A = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
  __Pyx_Buffer __pyx_pybuffer_A;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  __pyx_pybuffer_A.pybuffer.buf = NULL;
  __pyx_pybuffer_A.refcount = 0;
  __pyx_pybuffernd_A.data = NULL;
  __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_11_BpfUnaryOp_7mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4172, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4172, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4172, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4172, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4172, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4173
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self._apply(<DTYPE_t *>(A.data), n)
 */
  __pyx_t_10.__pyx_n = 1;
  __pyx_t_10.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->mapn_between(__pyx_v_self->a, __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_A = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_A.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4173, __pyx_L1_error)
    } else {__pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_A = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4174
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self._apply(<DTYPE_t *>(A.data), n)
 *         return A
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "bpf4/core.pyx":4175
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         with nogil:
 *             self._apply(<DTYPE_t *>(A.data), n)             # <<<<<<<<<<<<<<
 *         return A
 * 
 */
        ((struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp *)__pyx_v_self->__pyx_base.__pyx_vtab)->_apply(__pyx_v_self, ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_A->data), __pyx_v_n);
      }

      /* "bpf4/core.pyx":4174
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self._apply(<DTYPE_t *>(A.data), n)
 *         return A
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "bpf4/core.pyx":4176
 *         with nogil:
 *             self._apply(<DTYPE_t *>(A.data), n)
 *         return A             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_A));
  __pyx_r = ((PyArrayObject *)__pyx_v_A);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4172
 *         pass
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core._BpfUnaryOp.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_A);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_11_BpfUnaryOp_7mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_11_BpfUnaryOp_6mapn_between[] = "_BpfUnaryOp.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray";
static PyMethodDef __pyx_mdef_4bpf4_4core_11_BpfUnaryOp_7mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_11_BpfUnaryOp_7mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_11_BpfUnaryOp_6mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_11_BpfUnaryOp_7mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 4172, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 4172, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 4172, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4172, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4172, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4172, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4172, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfUnaryOp.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 4172, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_11_BpfUnaryOp_6mapn_between(((struct __pyx_obj_4bpf4_4core__BpfUnaryOp *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_11_BpfUnaryOp_6mapn_between(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__BpfUnaryOp->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfUnaryOp.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4178
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */

static PyObject *__pyx_pw_4bpf4_4core_11_BpfUnaryOp_9map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_11_BpfUnaryOp_map(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_11_BpfUnaryOp_map *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  PyArrayObject *__pyx_v_A = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
  __Pyx_Buffer __pyx_pybuffer_A;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  __pyx_pybuffer_A.pybuffer.buf = NULL;
  __pyx_pybuffer_A.refcount = 0;
  __pyx_pybuffernd_A.data = NULL;
  __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_11_BpfUnaryOp_9map)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4178, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4178, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4178, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(__pyx_v_xs);
          __Pyx_GIVEREF(__pyx_v_xs);
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_xs);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_out));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4178, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4178, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4189
 *         """
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A
 *         if isinstance(xs, (int, long)):             # <<<<<<<<<<<<<<
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         A = self.a.map(xs, out)
 */
  __pyx_t_8 = PyInt_Check(__pyx_v_xs); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (!__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = PyLong_Check(__pyx_v_xs); 
  __pyx_t_8 = (__pyx_t_9 != 0);
  __pyx_t_7 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "bpf4/core.pyx":4190
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A
 *         if isinstance(xs, (int, long)):
 *             return self.mapn_between(xs, self._x0, self._x1, out)             # <<<<<<<<<<<<<<
 *         A = self.a.map(xs, out)
 *         self._apply(<DTYPE_t *>(A.data), len(xs))
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_xs); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4190, __pyx_L1_error)
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.out = __pyx_v_out;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_t_5, __pyx_v_self->__pyx_base._x0, __pyx_v_self->__pyx_base._x1, 0, &__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4189
 *         """
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A
 *         if isinstance(xs, (int, long)):             # <<<<<<<<<<<<<<
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         A = self.a.map(xs, out)
 */
  }

  /* "bpf4/core.pyx":4191
 *         if isinstance(xs, (int, long)):
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         A = self.a.map(xs, out)             # <<<<<<<<<<<<<<
 *         self._apply(<DTYPE_t *>(A.data), len(xs))
 *         return A
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->map(__pyx_v_self->a, __pyx_v_xs, 0, &__pyx_t_11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      }
      __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0;
    }
    __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4191, __pyx_L1_error)
  }
  __pyx_v_A = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4192
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         A = self.a.map(xs, out)
 *         self._apply(<DTYPE_t *>(A.data), len(xs))             # <<<<<<<<<<<<<<
 *         return A
 * 
 */
  __pyx_t_15 = PyObject_Length(__pyx_v_xs); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4192, __pyx_L1_error)
  ((struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp *)__pyx_v_self->__pyx_base.__pyx_vtab)->_apply(__pyx_v_self, ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_A->data), __pyx_t_15);

  /* "bpf4/core.pyx":4193
 *         A = self.a.map(xs, out)
 *         self._apply(<DTYPE_t *>(A.data), len(xs))
 *         return A             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_A));
  __pyx_r = ((PyArrayObject *)__pyx_v_A);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4178
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core._BpfUnaryOp.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_A);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_11_BpfUnaryOp_9map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_11_BpfUnaryOp_8map[] = "_BpfUnaryOp.map(self, xs, ndarray out=None) -> ndarray\n\n        the same as map(self, xs) but somewhat faster\n\n        xs can also be a number, in which case it is interpreted as\n        the number of elements to calculate in an evenly spaced\n        grid between the bounds of this bpf.\n        bpf.map(10) == bpf.map(numpy.linspace(x0, x1, 10))\n        ( this is the same as bpf.mapn_between(10, bpf.x0, bpf.x1) )\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_11_BpfUnaryOp_9map = {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_11_BpfUnaryOp_9map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_11_BpfUnaryOp_8map};
static PyObject *__pyx_pw_4bpf4_4core_11_BpfUnaryOp_9map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_out,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 4178, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_out = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4178, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfUnaryOp.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 4178, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_11_BpfUnaryOp_8map(((struct __pyx_obj_4bpf4_4core__BpfUnaryOp *)__pyx_v_self), __pyx_v_xs, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_11_BpfUnaryOp_8map(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__BpfUnaryOp->__pyx_base.map(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_xs, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfUnaryOp.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4203
 *     cdef BpfInterface a
 * 
 *     def __init__(_BpfBinOpConst self, BpfInterface a, double b, tuple bounds, str op=''):             # <<<<<<<<<<<<<<
 *         self.a = a
 *         self.b_const = b
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a = 0;
  double __pyx_v_b;
  PyObject *__pyx_v_bounds = 0;
  CYTHON_UNUSED PyObject *__pyx_v_op = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_bounds,&__pyx_n_s_op,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject*)__pyx_kp_u__6);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 4203, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 4203, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 4203, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
    __pyx_v_b = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4203, __pyx_L3_error)
    __pyx_v_bounds = ((PyObject*)values[2]);
    __pyx_v_op = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4203, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfBinOpConst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "a", 0))) __PYX_ERR(0, 4203, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bounds), (&PyTuple_Type), 1, "bounds", 1))) __PYX_ERR(0, 4203, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), (&PyUnicode_Type), 1, "op", 1))) __PYX_ERR(0, 4203, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfBinOpConst___init__(((struct __pyx_obj_4bpf4_4core__BpfBinOpConst *)__pyx_v_self), __pyx_v_a, __pyx_v_b, __pyx_v_bounds, __pyx_v_op);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_14_BpfBinOpConst___init__(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, double __pyx_v_b, PyObject *__pyx_v_bounds, CYTHON_UNUSED PyObject *__pyx_v_op) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  double __pyx_t_3;
  double __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":4204
 * 
 *     def __init__(_BpfBinOpConst self, BpfInterface a, double b, tuple bounds, str op=''):
 *         self.a = a             # <<<<<<<<<<<<<<
 *         self.b_const = b
 *         self._x0, self._x1 = bounds
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_a));
  __Pyx_GOTREF(__pyx_v_self->a);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->a));
  __pyx_v_self->a = __pyx_v_a;

  /* "bpf4/core.pyx":4205
 *     def __init__(_BpfBinOpConst self, BpfInterface a, double b, tuple bounds, str op=''):
 *         self.a = a
 *         self.b_const = b             # <<<<<<<<<<<<<<
 *         self._x0, self._x1 = bounds
 * 
 */
  __pyx_v_self->b_const = __pyx_v_b;

  /* "bpf4/core.pyx":4206
 *         self.a = a
 *         self.b_const = b
 *         self._x0, self._x1 = bounds             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  if (likely(__pyx_v_bounds != Py_None)) {
    PyObject* sequence = __pyx_v_bounds;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 4206, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 4206, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->__pyx_base._x0 = __pyx_t_3;
  __pyx_v_self->__pyx_base._x1 = __pyx_t_4;

  /* "bpf4/core.pyx":4203
 *     cdef BpfInterface a
 * 
 *     def __init__(_BpfBinOpConst self, BpfInterface a, double b, tuple bounds, str op=''):             # <<<<<<<<<<<<<<
 *         self.a = a
 *         self.b_const = b
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core._BpfBinOpConst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4208
 *         self._x0, self._x1 = bounds
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b_const, (self._x0, self._x1)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfBinOpConst_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_14_BpfBinOpConst_2__getstate__[] = "_BpfBinOpConst.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_14_BpfBinOpConst_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfBinOpConst_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_14_BpfBinOpConst_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_14_BpfBinOpConst_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfBinOpConst_2__getstate__(((struct __pyx_obj_4bpf4_4core__BpfBinOpConst *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfBinOpConst_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":4209
 * 
 *     def __getstate__(self):
 *         return self.a, self.b_const, (self._x0, self._x1)             # <<<<<<<<<<<<<<
 * 
 *     def _get_xs_for_rendering(self, int n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->b_const); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._x0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._x1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->a));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->a));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->a));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4208
 *         self._x0, self._x1 = bounds
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b_const, (self._x0, self._x1)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfBinOpConst.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4211
 *         return self.a, self.b_const, (self._x0, self._x1)
 * 
 *     def _get_xs_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         return self.a._get_xs_for_rendering(n)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfBinOpConst_5_get_xs_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
static char __pyx_doc_4bpf4_4core_14_BpfBinOpConst_4_get_xs_for_rendering[] = "_BpfBinOpConst._get_xs_for_rendering(self, int n)";
static PyMethodDef __pyx_mdef_4bpf4_4core_14_BpfBinOpConst_5_get_xs_for_rendering = {"_get_xs_for_rendering", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfBinOpConst_5_get_xs_for_rendering, METH_O, __pyx_doc_4bpf4_4core_14_BpfBinOpConst_4_get_xs_for_rendering};
static PyObject *__pyx_pw_4bpf4_4core_14_BpfBinOpConst_5_get_xs_for_rendering(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
  int __pyx_v_n;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_xs_for_rendering (wrapper)", 0);
  assert(__pyx_arg_n); {
    __pyx_v_n = __Pyx_PyInt_As_int(__pyx_arg_n); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4211, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfBinOpConst._get_xs_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfBinOpConst_4_get_xs_for_rendering(((struct __pyx_obj_4bpf4_4core__BpfBinOpConst *)__pyx_v_self), ((int)__pyx_v_n));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfBinOpConst_4_get_xs_for_rendering(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self, int __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_xs_for_rendering", 0);

  /* "bpf4/core.pyx":4212
 * 
 *     def _get_xs_for_rendering(self, int n):
 *         return self.a._get_xs_for_rendering(n)             # <<<<<<<<<<<<<<
 * 
 *     cdef void _apply(self, DTYPE_t *A, int n, double x) nogil:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->a), __pyx_n_s_get_xs_for_rendering); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4211
 *         return self.a, self.b_const, (self._x0, self._x1)
 * 
 *     def _get_xs_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         return self.a._get_xs_for_rendering(n)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfBinOpConst._get_xs_for_rendering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4214
 *         return self.a._get_xs_for_rendering(n)
 * 
 *     cdef void _apply(self, DTYPE_t *A, int n, double x) nogil:             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static void __pyx_f_4bpf4_4core_14_BpfBinOpConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self, CYTHON_UNUSED __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, CYTHON_UNUSED int __pyx_v_n, CYTHON_UNUSED double __pyx_v_x) {

  /* function exit code */
}

/* "bpf4/core.pyx":4217
 *         pass
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */

static PyObject *__pyx_pw_4bpf4_4core_14_BpfBinOpConst_7map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_14_BpfBinOpConst_map(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self, PyObject *__pyx_v_xs, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_14_BpfBinOpConst_map *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  PyArrayObject *__pyx_v_A = 0;
  int __pyx_v_len_xs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
  __Pyx_Buffer __pyx_pybuffer_A;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  __pyx_pybuffer_A.pybuffer.buf = NULL;
  __pyx_pybuffer_A.refcount = 0;
  __pyx_pybuffernd_A.data = NULL;
  __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_14_BpfBinOpConst_7map)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4217, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_xs, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4217, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4217, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
          }
          __Pyx_INCREF(__pyx_v_xs);
          __Pyx_GIVEREF(__pyx_v_xs);
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_xs);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_out));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4217, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4217, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4241
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A
 *         cdef int len_xs
 *         if isinstance(xs, (int, long)):             # <<<<<<<<<<<<<<
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         A = self.a.map(xs, out)
 */
  __pyx_t_8 = PyInt_Check(__pyx_v_xs); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (!__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = PyLong_Check(__pyx_v_xs); 
  __pyx_t_8 = (__pyx_t_9 != 0);
  __pyx_t_7 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "bpf4/core.pyx":4242
 *         cdef int len_xs
 *         if isinstance(xs, (int, long)):
 *             return self.mapn_between(xs, self._x0, self._x1, out)             # <<<<<<<<<<<<<<
 *         A = self.a.map(xs, out)
 *         len_xs = len(xs)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_xs); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4242, __pyx_L1_error)
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.out = __pyx_v_out;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_t_5, __pyx_v_self->__pyx_base._x0, __pyx_v_self->__pyx_base._x1, 0, &__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4241
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A
 *         cdef int len_xs
 *         if isinstance(xs, (int, long)):             # <<<<<<<<<<<<<<
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         A = self.a.map(xs, out)
 */
  }

  /* "bpf4/core.pyx":4243
 *         if isinstance(xs, (int, long)):
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         A = self.a.map(xs, out)             # <<<<<<<<<<<<<<
 *         len_xs = len(xs)
 *         with nogil:
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->map(__pyx_v_self->a, __pyx_v_xs, 0, &__pyx_t_11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      }
      __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0;
    }
    __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 4243, __pyx_L1_error)
  }
  __pyx_v_A = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4244
 *             return self.mapn_between(xs, self._x0, self._x1, out)
 *         A = self.a.map(xs, out)
 *         len_xs = len(xs)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             self._apply(<DTYPE_t *>(A.data), len_xs, self.b_const)
 */
  __pyx_t_15 = PyObject_Length(__pyx_v_xs); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 4244, __pyx_L1_error)
  __pyx_v_len_xs = __pyx_t_15;

  /* "bpf4/core.pyx":4245
 *         A = self.a.map(xs, out)
 *         len_xs = len(xs)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self._apply(<DTYPE_t *>(A.data), len_xs, self.b_const)
 *         return A
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "bpf4/core.pyx":4246
 *         len_xs = len(xs)
 *         with nogil:
 *             self._apply(<DTYPE_t *>(A.data), len_xs, self.b_const)             # <<<<<<<<<<<<<<
 *         return A
 * 
 */
        ((struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_apply(__pyx_v_self, ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_A->data), __pyx_v_len_xs, __pyx_v_self->b_const);
      }

      /* "bpf4/core.pyx":4245
 *         A = self.a.map(xs, out)
 *         len_xs = len(xs)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self._apply(<DTYPE_t *>(A.data), len_xs, self.b_const)
 *         return A
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L8:;
      }
  }

  /* "bpf4/core.pyx":4247
 *         with nogil:
 *             self._apply(<DTYPE_t *>(A.data), len_xs, self.b_const)
 *         return A             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_A));
  __pyx_r = ((PyArrayObject *)__pyx_v_A);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4217
 *         pass
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core._BpfBinOpConst.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_A);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfBinOpConst_7map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_14_BpfBinOpConst_6map[] = "_BpfBinOpConst.map(self, xs, ndarray out=None) -> ndarray\n\n        the same as map(self, xs) but somewhat faster\n\n        Args:\n            xs (ndarray | int): the points to evaluate this bpf at, or an\n                int indicating the number of points to sample this bpf\n                at within its bounds\n            out (ndarray): if given, the results of the evaluation\n                are placed here. It must be the same size as `xs`\n\n        Returns:\n            (ndarray) The resulting array\n\n        **NB**: `xs`` can be a number, in which case it is interpreted as\n        the number of elements to calculate in an evenly spaced\n        grid between the bounds of this bpf.\n        \n        `bpf.map(10) == bpf.map(numpy.linspace(x0, x1, 10))`\n\n        This is the same as `bpf.mapn_between(10, bpf.x0, bpf.x1)`\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_14_BpfBinOpConst_7map = {"map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_14_BpfBinOpConst_7map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_14_BpfBinOpConst_6map};
static PyObject *__pyx_pw_4bpf4_4core_14_BpfBinOpConst_7map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xs = 0;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xs,&__pyx_n_s_out,0};
    PyObject* values[2] = {0,0};
    values[1] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(0, 4217, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_xs = values[0];
    __pyx_v_out = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4217, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfBinOpConst.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 4217, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfBinOpConst_6map(((struct __pyx_obj_4bpf4_4core__BpfBinOpConst *)__pyx_v_self), __pyx_v_xs, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfBinOpConst_6map(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self, PyObject *__pyx_v_xs, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__BpfBinOpConst->__pyx_base.map(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_xs, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfBinOpConst.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4249
 *         return A
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double A = self.a.__ccall__(x)
 *         self._apply(&A, 1, self.b_const)
 */

static double __pyx_f_4bpf4_4core_14_BpfBinOpConst___ccall__(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_A;
  double __pyx_r;

  /* "bpf4/core.pyx":4250
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double A = self.a.__ccall__(x)             # <<<<<<<<<<<<<<
 *         self._apply(&A, 1, self.b_const)
 *         return A
 */
  __pyx_v_A = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->a->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->a, __pyx_v_x);

  /* "bpf4/core.pyx":4251
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double A = self.a.__ccall__(x)
 *         self._apply(&A, 1, self.b_const)             # <<<<<<<<<<<<<<
 *         return A
 * 
 */
  ((struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_apply(__pyx_v_self, (&__pyx_v_A), 1, __pyx_v_self->b_const);

  /* "bpf4/core.pyx":4252
 *         cdef double A = self.a.__ccall__(x)
 *         self._apply(&A, 1, self.b_const)
 *         return A             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_A;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4249
 *         return A
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double A = self.a.__ccall__(x)
 *         self._apply(&A, 1, self.b_const)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4256
 * 
 * cdef class _BpfLambdaAdd(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] += B[i]
 */

static void __pyx_f_4bpf4_4core_13_BpfLambdaAdd__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaAdd *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":4257
 * cdef class _BpfLambdaAdd(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] += B[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4258
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] += B[i]             # <<<<<<<<<<<<<<
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 */
    __pyx_t_4 = __pyx_v_i;
    (__pyx_v_A[__pyx_t_4]) = ((__pyx_v_A[__pyx_t_4]) + (__pyx_v_B[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4256
 * 
 * cdef class _BpfLambdaAdd(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] += B[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4260
 *             A[i] += B[i]
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) + self.b.integrate_between(x0, x1, N)
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_13_BpfLambdaAdd_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_4bpf4_4core_13_BpfLambdaAdd_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaAdd *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_13_BpfLambdaAdd_integrate_between *__pyx_optional_args) {
  size_t __pyx_v_N = ((size_t)0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_11;
  double __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_13_BpfLambdaAdd_1integrate_between)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4260, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4260, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4260, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4260, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4260, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4260, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4260, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4260, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4261
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         return self.a.integrate_between(x0, x1, N) + self.b.integrate_between(x0, x1, N)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.N = __pyx_v_N;
  __pyx_t_10 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_base.a->__pyx_vtab)->integrate_between(__pyx_v_self->__pyx_base.a, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11); 
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.N = __pyx_v_N;
  __pyx_t_12 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_base.b->__pyx_vtab)->integrate_between(__pyx_v_self->__pyx_base.b, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11); 
  __pyx_r = (__pyx_t_10 + __pyx_t_12);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4260
 *             A[i] += B[i]
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) + self.b.integrate_between(x0, x1, N)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("bpf4.core._BpfLambdaAdd.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_BpfLambdaAdd_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_13_BpfLambdaAdd_integrate_between[] = "_BpfLambdaAdd.integrate_between(self, double x0, double x1, size_t N=0) -> double";
static PyMethodDef __pyx_mdef_4bpf4_4core_13_BpfLambdaAdd_1integrate_between = {"integrate_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_13_BpfLambdaAdd_1integrate_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_13_BpfLambdaAdd_integrate_between};
static PyObject *__pyx_pw_4bpf4_4core_13_BpfLambdaAdd_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  size_t __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, 1); __PYX_ERR(0, 4260, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_between") < 0)) __PYX_ERR(0, 4260, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4260, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4260, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_N == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4260, __pyx_L3_error)
    } else {
      __pyx_v_N = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4260, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfLambdaAdd.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfLambdaAdd_integrate_between(((struct __pyx_obj_4bpf4_4core__BpfLambdaAdd *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_BpfLambdaAdd_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaAdd *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core__BpfLambdaAdd->__pyx_base.__pyx_base.integrate_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2); 
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaAdd.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4265
 * 
 * cdef class _BpfLambdaAddConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] += b
 */

static void __pyx_f_4bpf4_4core_18_BpfLambdaAddConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaAddConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":4266
 * cdef class _BpfLambdaAddConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] += b
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4267
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] += b             # <<<<<<<<<<<<<<
 * 
 *     def __add__(a, b):
 */
    __pyx_t_4 = __pyx_v_i;
    (__pyx_v_A[__pyx_t_4]) = ((__pyx_v_A[__pyx_t_4]) + __pyx_v_b);
  }

  /* "bpf4/core.pyx":4265
 * 
 * cdef class _BpfLambdaAddConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] += b
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4269
 *             A[i] += b
 * 
 *     def __add__(a, b):             # <<<<<<<<<<<<<<
 *         cdef double c
 *         if isinstance(a, BpfInterface):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_18_BpfLambdaAddConst_1__add__(PyObject *__pyx_v_a, PyObject *__pyx_v_b); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_18_BpfLambdaAddConst_1__add__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_18_BpfLambdaAddConst___add__(((PyObject *)__pyx_v_a), ((PyObject *)__pyx_v_b));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_18_BpfLambdaAddConst___add__(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  double __pyx_v_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  double __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__add__", 0);

  /* "bpf4/core.pyx":4271
 *     def __add__(a, b):
 *         cdef double c
 *         if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *             try:
 *                 c = float(b)
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_a, __pyx_ptype_4bpf4_4core_BpfInterface); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":4272
 *         cdef double c
 *         if isinstance(a, BpfInterface):
 *             try:             # <<<<<<<<<<<<<<
 *                 c = float(b)
 *                 return _BpfLambdaAddConst(a.a, a.b + c)
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "bpf4/core.pyx":4273
 *         if isinstance(a, BpfInterface):
 *             try:
 *                 c = float(b)             # <<<<<<<<<<<<<<
 *                 return _BpfLambdaAddConst(a.a, a.b + c)
 *             except:
 */
        __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_v_b); if (unlikely(__pyx_t_6 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4273, __pyx_L4_error)
        __pyx_v_c = __pyx_t_6;

        /* "bpf4/core.pyx":4274
 *             try:
 *                 c = float(b)
 *                 return _BpfLambdaAddConst(a.a, a.b + c)             # <<<<<<<<<<<<<<
 *             except:
 *                 return _BpfBinOpConst.__add__(a, b)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4274, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_b); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4274, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PyFloat_FromDouble(__pyx_v_c); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4274, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = PyNumber_Add(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4274, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4274, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
        __pyx_t_7 = 0;
        __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaAddConst), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4274, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_r = __pyx_t_10;
        __pyx_t_10 = 0;
        goto __pyx_L8_try_return;

        /* "bpf4/core.pyx":4272
 *         cdef double c
 *         if isinstance(a, BpfInterface):
 *             try:             # <<<<<<<<<<<<<<
 *                 c = float(b)
 *                 return _BpfLambdaAddConst(a.a, a.b + c)
 */
      }
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "bpf4/core.pyx":4275
 *                 c = float(b)
 *                 return _BpfLambdaAddConst(a.a, a.b + c)
 *             except:             # <<<<<<<<<<<<<<
 *                 return _BpfBinOpConst.__add__(a, b)
 *         else:
 */
      /*except:*/ {
        __Pyx_AddTraceback("bpf4.core._BpfLambdaAddConst.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 4275, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GOTREF(__pyx_t_7);

        /* "bpf4/core.pyx":4276
 *                 return _BpfLambdaAddConst(a.a, a.b + c)
 *             except:
 *                 return _BpfBinOpConst.__add__(a, b)             # <<<<<<<<<<<<<<
 *         else:
 *             try:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core__BpfBinOpConst), __pyx_n_s_add); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4276, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = NULL;
        __pyx_t_13 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
            __pyx_t_13 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_11)) {
          PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_a, __pyx_v_b};
          __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4276, __pyx_L6_except_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_8);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
          PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_a, __pyx_v_b};
          __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4276, __pyx_L6_except_error)
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_8);
        } else
        #endif
        {
          __pyx_t_14 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 4276, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
          }
          __Pyx_INCREF(__pyx_v_a);
          __Pyx_GIVEREF(__pyx_v_a);
          PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_v_a);
          __Pyx_INCREF(__pyx_v_b);
          __Pyx_GIVEREF(__pyx_v_b);
          PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_v_b);
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4276, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L7_except_return;
      }
      __pyx_L6_except_error:;

      /* "bpf4/core.pyx":4272
 *         cdef double c
 *         if isinstance(a, BpfInterface):
 *             try:             # <<<<<<<<<<<<<<
 *                 c = float(b)
 *                 return _BpfLambdaAddConst(a.a, a.b + c)
 */
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L8_try_return:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L0;
      __pyx_L7_except_return:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L0;
    }

    /* "bpf4/core.pyx":4271
 *     def __add__(a, b):
 *         cdef double c
 *         if isinstance(a, BpfInterface):             # <<<<<<<<<<<<<<
 *             try:
 *                 c = float(b)
 */
  }

  /* "bpf4/core.pyx":4278
 *                 return _BpfBinOpConst.__add__(a, b)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 c = float(a)
 *                 return _BpfLambdaAddConst(b.a, b.b + a)
 */
  /*else*/ {
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_3);
      /*try:*/ {

        /* "bpf4/core.pyx":4279
 *         else:
 *             try:
 *                 c = float(a)             # <<<<<<<<<<<<<<
 *                 return _BpfLambdaAddConst(b.a, b.b + a)
 *             except:
 */
        __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_v_a); if (unlikely(__pyx_t_6 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4279, __pyx_L12_error)
        __pyx_v_c = __pyx_t_6;

        /* "bpf4/core.pyx":4280
 *             try:
 *                 c = float(a)
 *                 return _BpfLambdaAddConst(b.a, b.b + a)             # <<<<<<<<<<<<<<
 *             except:
 *                 return _BpfBinOpConst.__add__(b, a)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4280, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_b); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4280, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = PyNumber_Add(__pyx_t_9, __pyx_v_a); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4280, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4280, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
        __pyx_t_7 = 0;
        __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaAddConst), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4280, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_r = __pyx_t_10;
        __pyx_t_10 = 0;
        goto __pyx_L16_try_return;

        /* "bpf4/core.pyx":4278
 *                 return _BpfBinOpConst.__add__(a, b)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 c = float(a)
 *                 return _BpfLambdaAddConst(b.a, b.b + a)
 */
      }
      __pyx_L12_error:;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "bpf4/core.pyx":4281
 *                 c = float(a)
 *                 return _BpfLambdaAddConst(b.a, b.b + a)
 *             except:             # <<<<<<<<<<<<<<
 *                 return _BpfBinOpConst.__add__(b, a)
 * 
 */
      /*except:*/ {
        __Pyx_AddTraceback("bpf4.core._BpfLambdaAddConst.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 4281, __pyx_L14_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GOTREF(__pyx_t_7);

        /* "bpf4/core.pyx":4282
 *                 return _BpfLambdaAddConst(b.a, b.b + a)
 *             except:
 *                 return _BpfBinOpConst.__add__(b, a)             # <<<<<<<<<<<<<<
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core__BpfBinOpConst), __pyx_n_s_add); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4282, __pyx_L14_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_14 = NULL;
        __pyx_t_13 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
            __pyx_t_13 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_11)) {
          PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_b, __pyx_v_a};
          __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4282, __pyx_L14_except_error)
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_8);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
          PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_b, __pyx_v_a};
          __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4282, __pyx_L14_except_error)
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_GOTREF(__pyx_t_8);
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4282, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_14) {
            __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); __pyx_t_14 = NULL;
          }
          __Pyx_INCREF(__pyx_v_b);
          __Pyx_GIVEREF(__pyx_v_b);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_13, __pyx_v_b);
          __Pyx_INCREF(__pyx_v_a);
          __Pyx_GIVEREF(__pyx_v_a);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_13, __pyx_v_a);
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4282, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L15_except_return;
      }
      __pyx_L14_except_error:;

      /* "bpf4/core.pyx":4278
 *                 return _BpfBinOpConst.__add__(a, b)
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 c = float(a)
 *                 return _BpfLambdaAddConst(b.a, b.b + a)
 */
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
      goto __pyx_L1_error;
      __pyx_L16_try_return:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
      goto __pyx_L0;
      __pyx_L15_except_return:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
      goto __pyx_L0;
    }
  }

  /* "bpf4/core.pyx":4269
 *             A[i] += b
 * 
 *     def __add__(a, b):             # <<<<<<<<<<<<<<
 *         cdef double c
 *         if isinstance(a, BpfInterface):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaAddConst.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4284
 *                 return _BpfBinOpConst.__add__(b, a)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) + (x1 - x0) * self.b_const
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_18_BpfLambdaAddConst_3integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_4bpf4_4core_18_BpfLambdaAddConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaAddConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_18_BpfLambdaAddConst_integrate_between *__pyx_optional_args) {
  size_t __pyx_v_N = ((size_t)0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_18_BpfLambdaAddConst_3integrate_between)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4284, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4284, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4284, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4284, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4284, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4284, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4284, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4284, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4285
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         return self.a.integrate_between(x0, x1, N) + (x1 - x0) * self.b_const             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.N = __pyx_v_N;
  __pyx_t_10 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_base.a->__pyx_vtab)->integrate_between(__pyx_v_self->__pyx_base.a, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11); 
  __pyx_r = (__pyx_t_10 + ((__pyx_v_x1 - __pyx_v_x0) * __pyx_v_self->__pyx_base.b_const));
  goto __pyx_L0;

  /* "bpf4/core.pyx":4284
 *                 return _BpfBinOpConst.__add__(b, a)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) + (x1 - x0) * self.b_const
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("bpf4.core._BpfLambdaAddConst.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_18_BpfLambdaAddConst_3integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_18_BpfLambdaAddConst_2integrate_between[] = "_BpfLambdaAddConst.integrate_between(self, double x0, double x1, size_t N=0) -> double";
static PyMethodDef __pyx_mdef_4bpf4_4core_18_BpfLambdaAddConst_3integrate_between = {"integrate_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_18_BpfLambdaAddConst_3integrate_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_18_BpfLambdaAddConst_2integrate_between};
static PyObject *__pyx_pw_4bpf4_4core_18_BpfLambdaAddConst_3integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  size_t __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, 1); __PYX_ERR(0, 4284, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_between") < 0)) __PYX_ERR(0, 4284, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4284, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4284, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_N == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4284, __pyx_L3_error)
    } else {
      __pyx_v_N = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4284, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfLambdaAddConst.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_18_BpfLambdaAddConst_2integrate_between(((struct __pyx_obj_4bpf4_4core__BpfLambdaAddConst *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_18_BpfLambdaAddConst_2integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaAddConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core__BpfLambdaAddConst->__pyx_base.__pyx_base.integrate_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2); 
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaAddConst.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4289
 * 
 * cdef class _BpfLambdaSub(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] -= B[i]
 */

static void __pyx_f_4bpf4_4core_13_BpfLambdaSub__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaSub *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":4290
 * cdef class _BpfLambdaSub(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] -= B[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4291
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] -= B[i]             # <<<<<<<<<<<<<<
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         return self.a.integrate_between(x0, x1, N) - self.b.integrate_between(x0, x1, N)
 */
    __pyx_t_4 = __pyx_v_i;
    (__pyx_v_A[__pyx_t_4]) = ((__pyx_v_A[__pyx_t_4]) - (__pyx_v_B[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4289
 * 
 * cdef class _BpfLambdaSub(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] -= B[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4292
 *         for i in range(n):
 *             A[i] -= B[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) - self.b.integrate_between(x0, x1, N)
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_13_BpfLambdaSub_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_4bpf4_4core_13_BpfLambdaSub_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaSub *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_13_BpfLambdaSub_integrate_between *__pyx_optional_args) {
  size_t __pyx_v_N = ((size_t)0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_11;
  double __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_13_BpfLambdaSub_1integrate_between)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4292, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4292, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4292, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4292, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4292, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4292, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4292, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4292, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4293
 *             A[i] -= B[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         return self.a.integrate_between(x0, x1, N) - self.b.integrate_between(x0, x1, N)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.N = __pyx_v_N;
  __pyx_t_10 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_base.a->__pyx_vtab)->integrate_between(__pyx_v_self->__pyx_base.a, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11); 
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.N = __pyx_v_N;
  __pyx_t_12 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_base.b->__pyx_vtab)->integrate_between(__pyx_v_self->__pyx_base.b, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11); 
  __pyx_r = (__pyx_t_10 - __pyx_t_12);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4292
 *         for i in range(n):
 *             A[i] -= B[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) - self.b.integrate_between(x0, x1, N)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("bpf4.core._BpfLambdaSub.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_BpfLambdaSub_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_13_BpfLambdaSub_integrate_between[] = "_BpfLambdaSub.integrate_between(self, double x0, double x1, size_t N=0) -> double";
static PyMethodDef __pyx_mdef_4bpf4_4core_13_BpfLambdaSub_1integrate_between = {"integrate_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_13_BpfLambdaSub_1integrate_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_13_BpfLambdaSub_integrate_between};
static PyObject *__pyx_pw_4bpf4_4core_13_BpfLambdaSub_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  size_t __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, 1); __PYX_ERR(0, 4292, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_between") < 0)) __PYX_ERR(0, 4292, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4292, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4292, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_N == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4292, __pyx_L3_error)
    } else {
      __pyx_v_N = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4292, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfLambdaSub.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfLambdaSub_integrate_between(((struct __pyx_obj_4bpf4_4core__BpfLambdaSub *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_BpfLambdaSub_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaSub *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core__BpfLambdaSub->__pyx_base.__pyx_base.integrate_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2); 
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaSub.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4297
 * 
 * cdef class _BpfLambdaRSub(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             B[i] -= A[i]
 */

static void __pyx_f_4bpf4_4core_14_BpfLambdaRSub__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaRSub *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":4298
 * cdef class _BpfLambdaRSub(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             B[i] -= A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4299
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             B[i] -= A[i]             # <<<<<<<<<<<<<<
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         return self.b.integrate_between(x0, x1, N) - self.a.integrate_between(x0, x1, N)
 */
    __pyx_t_4 = __pyx_v_i;
    (__pyx_v_B[__pyx_t_4]) = ((__pyx_v_B[__pyx_t_4]) - (__pyx_v_A[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4297
 * 
 * cdef class _BpfLambdaRSub(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             B[i] -= A[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4300
 *         for i in range(n):
 *             B[i] -= A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.b.integrate_between(x0, x1, N) - self.a.integrate_between(x0, x1, N)
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_14_BpfLambdaRSub_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_4bpf4_4core_14_BpfLambdaRSub_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaRSub *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_14_BpfLambdaRSub_integrate_between *__pyx_optional_args) {
  size_t __pyx_v_N = ((size_t)0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_11;
  double __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_14_BpfLambdaRSub_1integrate_between)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4300, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4300, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4300, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4300, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4300, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4301
 *             B[i] -= A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         return self.b.integrate_between(x0, x1, N) - self.a.integrate_between(x0, x1, N)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.N = __pyx_v_N;
  __pyx_t_10 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_base.b->__pyx_vtab)->integrate_between(__pyx_v_self->__pyx_base.b, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11); 
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.N = __pyx_v_N;
  __pyx_t_12 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_base.a->__pyx_vtab)->integrate_between(__pyx_v_self->__pyx_base.a, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11); 
  __pyx_r = (__pyx_t_10 - __pyx_t_12);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4300
 *         for i in range(n):
 *             B[i] -= A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.b.integrate_between(x0, x1, N) - self.a.integrate_between(x0, x1, N)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("bpf4.core._BpfLambdaRSub.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfLambdaRSub_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_14_BpfLambdaRSub_integrate_between[] = "_BpfLambdaRSub.integrate_between(self, double x0, double x1, size_t N=0) -> double";
static PyMethodDef __pyx_mdef_4bpf4_4core_14_BpfLambdaRSub_1integrate_between = {"integrate_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_14_BpfLambdaRSub_1integrate_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_14_BpfLambdaRSub_integrate_between};
static PyObject *__pyx_pw_4bpf4_4core_14_BpfLambdaRSub_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  size_t __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, 1); __PYX_ERR(0, 4300, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_between") < 0)) __PYX_ERR(0, 4300, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4300, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4300, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_N == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4300, __pyx_L3_error)
    } else {
      __pyx_v_N = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4300, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfLambdaRSub.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfLambdaRSub_integrate_between(((struct __pyx_obj_4bpf4_4core__BpfLambdaRSub *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfLambdaRSub_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaRSub *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core__BpfLambdaRSub->__pyx_base.__pyx_base.integrate_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2); 
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaRSub.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4305
 * 
 * cdef class _BpfLambdaSubConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] -= b
 */

static void __pyx_f_4bpf4_4core_18_BpfLambdaSubConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaSubConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":4306
 * cdef class _BpfLambdaSubConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] -= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4307
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] -= b             # <<<<<<<<<<<<<<
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         return self.a.integrate_between(x0, x1, N) - (x1-x0)*self.b_const
 */
    __pyx_t_4 = __pyx_v_i;
    (__pyx_v_A[__pyx_t_4]) = ((__pyx_v_A[__pyx_t_4]) - __pyx_v_b);
  }

  /* "bpf4/core.pyx":4305
 * 
 * cdef class _BpfLambdaSubConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] -= b
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4308
 *         for i in range(n):
 *             A[i] -= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) - (x1-x0)*self.b_const
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_18_BpfLambdaSubConst_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_4bpf4_4core_18_BpfLambdaSubConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaSubConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_18_BpfLambdaSubConst_integrate_between *__pyx_optional_args) {
  size_t __pyx_v_N = ((size_t)0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_18_BpfLambdaSubConst_1integrate_between)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4308, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4308, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4308, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4308, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4308, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4308, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4308, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4308, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4309
 *             A[i] -= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         return self.a.integrate_between(x0, x1, N) - (x1-x0)*self.b_const             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.N = __pyx_v_N;
  __pyx_t_10 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_base.a->__pyx_vtab)->integrate_between(__pyx_v_self->__pyx_base.a, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11); 
  __pyx_r = (__pyx_t_10 - ((__pyx_v_x1 - __pyx_v_x0) * __pyx_v_self->__pyx_base.b_const));
  goto __pyx_L0;

  /* "bpf4/core.pyx":4308
 *         for i in range(n):
 *             A[i] -= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) - (x1-x0)*self.b_const
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("bpf4.core._BpfLambdaSubConst.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_18_BpfLambdaSubConst_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_18_BpfLambdaSubConst_integrate_between[] = "_BpfLambdaSubConst.integrate_between(self, double x0, double x1, size_t N=0) -> double";
static PyMethodDef __pyx_mdef_4bpf4_4core_18_BpfLambdaSubConst_1integrate_between = {"integrate_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_18_BpfLambdaSubConst_1integrate_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_18_BpfLambdaSubConst_integrate_between};
static PyObject *__pyx_pw_4bpf4_4core_18_BpfLambdaSubConst_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  size_t __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, 1); __PYX_ERR(0, 4308, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_between") < 0)) __PYX_ERR(0, 4308, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4308, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4308, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_N == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4308, __pyx_L3_error)
    } else {
      __pyx_v_N = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4308, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfLambdaSubConst.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_18_BpfLambdaSubConst_integrate_between(((struct __pyx_obj_4bpf4_4core__BpfLambdaSubConst *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_18_BpfLambdaSubConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaSubConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core__BpfLambdaSubConst->__pyx_base.__pyx_base.integrate_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2); 
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaSubConst.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4313
 * 
 * cdef class _BpfLambdaRSubConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = b - A[i]
 */

static void __pyx_f_4bpf4_4core_19_BpfLambdaRSubConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaRSubConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4314
 * cdef class _BpfLambdaRSubConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = b - A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4315
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] = b - A[i]             # <<<<<<<<<<<<<<
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         return self.b_const*(x1-x0) - self.a.integrate_between(x0, x1, N)
 */
    (__pyx_v_A[__pyx_v_i]) = (__pyx_v_b - (__pyx_v_A[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4313
 * 
 * cdef class _BpfLambdaRSubConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = b - A[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4316
 *         for i in range(n):
 *             A[i] = b - A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.b_const*(x1-x0) - self.a.integrate_between(x0, x1, N)
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_19_BpfLambdaRSubConst_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_4bpf4_4core_19_BpfLambdaRSubConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaRSubConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_19_BpfLambdaRSubConst_integrate_between *__pyx_optional_args) {
  size_t __pyx_v_N = ((size_t)0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_19_BpfLambdaRSubConst_1integrate_between)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4316, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4316, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4316, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4316, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4316, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4316, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4316, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4316, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4317
 *             A[i] = b - A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         return self.b_const*(x1-x0) - self.a.integrate_between(x0, x1, N)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.N = __pyx_v_N;
  __pyx_t_10 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_base.a->__pyx_vtab)->integrate_between(__pyx_v_self->__pyx_base.a, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11); 
  __pyx_r = ((__pyx_v_self->__pyx_base.b_const * (__pyx_v_x1 - __pyx_v_x0)) - __pyx_t_10);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4316
 *         for i in range(n):
 *             A[i] = b - A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.b_const*(x1-x0) - self.a.integrate_between(x0, x1, N)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("bpf4.core._BpfLambdaRSubConst.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_19_BpfLambdaRSubConst_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_19_BpfLambdaRSubConst_integrate_between[] = "_BpfLambdaRSubConst.integrate_between(self, double x0, double x1, size_t N=0) -> double";
static PyMethodDef __pyx_mdef_4bpf4_4core_19_BpfLambdaRSubConst_1integrate_between = {"integrate_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_19_BpfLambdaRSubConst_1integrate_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_19_BpfLambdaRSubConst_integrate_between};
static PyObject *__pyx_pw_4bpf4_4core_19_BpfLambdaRSubConst_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  size_t __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, 1); __PYX_ERR(0, 4316, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_between") < 0)) __PYX_ERR(0, 4316, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4316, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4316, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_N == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4316, __pyx_L3_error)
    } else {
      __pyx_v_N = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4316, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfLambdaRSubConst.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_19_BpfLambdaRSubConst_integrate_between(((struct __pyx_obj_4bpf4_4core__BpfLambdaRSubConst *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_19_BpfLambdaRSubConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaRSubConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core__BpfLambdaRSubConst->__pyx_base.__pyx_base.integrate_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2); 
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaRSubConst.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4321
 * 
 * cdef class _BpfLambdaMul(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] *= B[i]
 */

static void __pyx_f_4bpf4_4core_13_BpfLambdaMul__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaMul *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":4322
 * cdef class _BpfLambdaMul(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] *= B[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4323
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] *= B[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_v_i;
    (__pyx_v_A[__pyx_t_4]) = ((__pyx_v_A[__pyx_t_4]) * (__pyx_v_B[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4321
 * 
 * cdef class _BpfLambdaMul(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] *= B[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4327
 * 
 * cdef class _BpfLambdaMulConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] *= b
 */

static void __pyx_f_4bpf4_4core_18_BpfLambdaMulConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaMulConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":4328
 * cdef class _BpfLambdaMulConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] *= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4329
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] *= b             # <<<<<<<<<<<<<<
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         return self.a.integrate_between(x0, x1, N) * self.b_const
 */
    __pyx_t_4 = __pyx_v_i;
    (__pyx_v_A[__pyx_t_4]) = ((__pyx_v_A[__pyx_t_4]) * __pyx_v_b);
  }

  /* "bpf4/core.pyx":4327
 * 
 * cdef class _BpfLambdaMulConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] *= b
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4330
 *         for i in range(n):
 *             A[i] *= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) * self.b_const
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_18_BpfLambdaMulConst_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_4bpf4_4core_18_BpfLambdaMulConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaMulConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_18_BpfLambdaMulConst_integrate_between *__pyx_optional_args) {
  size_t __pyx_v_N = ((size_t)0);
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_18_BpfLambdaMulConst_1integrate_between)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4330, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4330, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4330, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4330, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4330, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4330, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4330, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4330, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4331
 *             A[i] *= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         return self.a.integrate_between(x0, x1, N) * self.b_const             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.N = __pyx_v_N;
  __pyx_t_10 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_base.a->__pyx_vtab)->integrate_between(__pyx_v_self->__pyx_base.a, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11); 
  __pyx_r = (__pyx_t_10 * __pyx_v_self->__pyx_base.b_const);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4330
 *         for i in range(n):
 *             A[i] *= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) * self.b_const
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("bpf4.core._BpfLambdaMulConst.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_18_BpfLambdaMulConst_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_18_BpfLambdaMulConst_integrate_between[] = "_BpfLambdaMulConst.integrate_between(self, double x0, double x1, size_t N=0) -> double";
static PyMethodDef __pyx_mdef_4bpf4_4core_18_BpfLambdaMulConst_1integrate_between = {"integrate_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_18_BpfLambdaMulConst_1integrate_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_18_BpfLambdaMulConst_integrate_between};
static PyObject *__pyx_pw_4bpf4_4core_18_BpfLambdaMulConst_1integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  size_t __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, 1); __PYX_ERR(0, 4330, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_between") < 0)) __PYX_ERR(0, 4330, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4330, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4330, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_N == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4330, __pyx_L3_error)
    } else {
      __pyx_v_N = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4330, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfLambdaMulConst.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_18_BpfLambdaMulConst_integrate_between(((struct __pyx_obj_4bpf4_4core__BpfLambdaMulConst *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_18_BpfLambdaMulConst_integrate_between(struct __pyx_obj_4bpf4_4core__BpfLambdaMulConst *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core__BpfLambdaMulConst->__pyx_base.__pyx_base.integrate_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2); 
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaMulConst.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4335
 * 
 * cdef class _BpfLambdaPow(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] ** B[i]
 */

static void __pyx_f_4bpf4_4core_13_BpfLambdaPow__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaPow *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4336
 * cdef class _BpfLambdaPow(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] ** B[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4337
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] = A[i] ** B[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = pow((__pyx_v_A[__pyx_v_i]), (__pyx_v_B[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4335
 * 
 * cdef class _BpfLambdaPow(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] ** B[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4341
 * 
 * cdef class _BpfLambdaPowConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] ** b
 */

static void __pyx_f_4bpf4_4core_18_BpfLambdaPowConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaPowConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4342
 * cdef class _BpfLambdaPowConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] ** b
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4343
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] = A[i] ** b             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = pow((__pyx_v_A[__pyx_v_i]), ((__pyx_t_4bpf4_4core_DTYPE_t)__pyx_v_b));
  }

  /* "bpf4/core.pyx":4341
 * 
 * cdef class _BpfLambdaPowConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] ** b
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4347
 * 
 * cdef class _BpfLambdaRPowConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = b ** A[i]
 */

static void __pyx_f_4bpf4_4core_19_BpfLambdaRPowConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaRPowConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4348
 * cdef class _BpfLambdaRPowConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = b ** A[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4349
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] = b ** A[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = pow(((__pyx_t_4bpf4_4core_DTYPE_t)__pyx_v_b), (__pyx_v_A[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4347
 * 
 * cdef class _BpfLambdaRPowConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = b ** A[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4354
 * cdef class _BpfLambdaDiv(_BpfBinOp):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] /= B[i]
 */

static void __pyx_f_4bpf4_4core_13_BpfLambdaDiv__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaDiv *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":4355
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] /= B[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4356
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] /= B[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_v_i;
    (__pyx_v_A[__pyx_t_4]) = ((__pyx_v_A[__pyx_t_4]) / (__pyx_v_B[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4354
 * cdef class _BpfLambdaDiv(_BpfBinOp):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] /= B[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4361
 * cdef class _BpfLambdaDivConst(_BpfBinOpConst):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] /= b
 */

static void __pyx_f_4bpf4_4core_18_BpfLambdaDivConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaDivConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":4362
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] /= b
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4363
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] /= b             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_v_i;
    (__pyx_v_A[__pyx_t_4]) = ((__pyx_v_A[__pyx_t_4]) / __pyx_v_b);
  }

  /* "bpf4/core.pyx":4361
 * cdef class _BpfLambdaDivConst(_BpfBinOpConst):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] /= b
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4368
 * cdef class _BpfLambdaMod(_BpfBinOp):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = fmod(A[i], B[i])
 */

static void __pyx_f_4bpf4_4core_13_BpfLambdaMod__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaMod *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4369
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = fmod(A[i], B[i])
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4370
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] = fmod(A[i], B[i])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = fmod((__pyx_v_A[__pyx_v_i]), (__pyx_v_B[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4368
 * cdef class _BpfLambdaMod(_BpfBinOp):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = fmod(A[i], B[i])
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4375
 * cdef class _BpfLambdaModConst(_BpfBinOpConst):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = fmod(A[i], b)
 */

static void __pyx_f_4bpf4_4core_18_BpfLambdaModConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaModConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4376
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = fmod(A[i], b)
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4377
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] = fmod(A[i], b)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = fmod((__pyx_v_A[__pyx_v_i]), __pyx_v_b);
  }

  /* "bpf4/core.pyx":4375
 * cdef class _BpfLambdaModConst(_BpfBinOpConst):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = fmod(A[i], b)
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4382
 * cdef class _BpfLambdaRDiv(_BpfBinOp):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = B[i] / A[i]
 */

static void __pyx_f_4bpf4_4core_14_BpfLambdaRDiv__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaRDiv *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4383
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = B[i] / A[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4384
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] = B[i] / A[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_B[__pyx_v_i]) / (__pyx_v_A[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4382
 * cdef class _BpfLambdaRDiv(_BpfBinOp):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = B[i] / A[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4389
 * cdef class _BpfLambdaRDivConst(_BpfBinOpConst):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = b / A[i]
 */

static void __pyx_f_4bpf4_4core_19_BpfLambdaRDivConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaRDivConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4390
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = b / A[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4391
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] = b / A[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = (((__pyx_t_4bpf4_4core_DTYPE_t)__pyx_v_b) / (__pyx_v_A[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4389
 * cdef class _BpfLambdaRDivConst(_BpfBinOpConst):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = b / A[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4395
 * 
 * cdef class _BpfLambdaGreaterThan(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] > B[i]
 */

static void __pyx_f_4bpf4_4core_21_BpfLambdaGreaterThan__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThan *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4396
 * cdef class _BpfLambdaGreaterThan(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] > B[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4397
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] = A[i] > B[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_A[__pyx_v_i]) > (__pyx_v_B[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4395
 * 
 * cdef class _BpfLambdaGreaterThan(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] > B[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4401
 * 
 * cdef class _BpfLambdaGreaterOrEqualThan(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] >= B[i]
 */

static void __pyx_f_4bpf4_4core_28_BpfLambdaGreaterOrEqualThan__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThan *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4402
 * cdef class _BpfLambdaGreaterOrEqualThan(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] >= B[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4403
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] = A[i] >= B[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_A[__pyx_v_i]) >= (__pyx_v_B[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4401
 * 
 * cdef class _BpfLambdaGreaterOrEqualThan(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] >= B[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4407
 * 
 * cdef class _BpfLambdaGreaterThanConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] > b
 */

static void __pyx_f_4bpf4_4core_26_BpfLambdaGreaterThanConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThanConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4408
 * cdef class _BpfLambdaGreaterThanConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] > b
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4409
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] = A[i] > b             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_A[__pyx_v_i]) > __pyx_v_b);
  }

  /* "bpf4/core.pyx":4407
 * 
 * cdef class _BpfLambdaGreaterThanConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] > b
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4413
 * 
 * cdef class _BpfLambdaGreaterOrEqualThanConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] >= b
 */

static void __pyx_f_4bpf4_4core_33_BpfLambdaGreaterOrEqualThanConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4414
 * cdef class _BpfLambdaGreaterOrEqualThanConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] >= b
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4415
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] = A[i] >= b             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_A[__pyx_v_i]) >= __pyx_v_b);
  }

  /* "bpf4/core.pyx":4413
 * 
 * cdef class _BpfLambdaGreaterOrEqualThanConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] >= b
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4419
 * 
 * cdef class _BpfLambdaLowerThan(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] < B[i]
 */

static void __pyx_f_4bpf4_4core_19_BpfLambdaLowerThan__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThan *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4420
 * cdef class _BpfLambdaLowerThan(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] < B[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4421
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] = A[i] < B[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_A[__pyx_v_i]) < (__pyx_v_B[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4419
 * 
 * cdef class _BpfLambdaLowerThan(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] < B[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4425
 * 
 * cdef class _BpfLambdaLowerThanConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] < b
 */

static void __pyx_f_4bpf4_4core_24_BpfLambdaLowerThanConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThanConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4426
 * cdef class _BpfLambdaLowerThanConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] < b
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4427
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] = A[i] < b             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_A[__pyx_v_i]) < __pyx_v_b);
  }

  /* "bpf4/core.pyx":4425
 * 
 * cdef class _BpfLambdaLowerThanConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] < b
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4431
 * 
 * cdef class _BpfLambdaLowerOrEqualThan(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] <= B[i]
 */

static void __pyx_f_4bpf4_4core_26_BpfLambdaLowerOrEqualThan__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThan *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4432
 * cdef class _BpfLambdaLowerOrEqualThan(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] <= B[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4433
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] = A[i] <= B[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_A[__pyx_v_i]) <= (__pyx_v_B[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4431
 * 
 * cdef class _BpfLambdaLowerOrEqualThan(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] <= B[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4437
 * 
 * cdef class _BpfLambdaLowerOrEqualThanConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] <= b
 */

static void __pyx_f_4bpf4_4core_31_BpfLambdaLowerOrEqualThanConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThanConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4438
 * cdef class _BpfLambdaLowerOrEqualThanConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] <= b
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4439
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] = A[i] <= b             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_A[__pyx_v_i]) <= __pyx_v_b);
  }

  /* "bpf4/core.pyx":4437
 * 
 * cdef class _BpfLambdaLowerOrEqualThanConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] <= b
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4443
 * 
 * cdef class _BpfLambdaEqual(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] == B[i]
 */

static void __pyx_f_4bpf4_4core_15_BpfLambdaEqual__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaEqual *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4444
 * cdef class _BpfLambdaEqual(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] == B[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4445
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] = A[i] == B[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_A[__pyx_v_i]) == (__pyx_v_B[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4443
 * 
 * cdef class _BpfLambdaEqual(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] == B[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4449
 * 
 * cdef class _BpfLambdaEqualConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] == b
 */

static void __pyx_f_4bpf4_4core_20_BpfLambdaEqualConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaEqualConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4450
 * cdef class _BpfLambdaEqualConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] == b
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4451
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] = A[i] == b             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_A[__pyx_v_i]) == __pyx_v_b);
  }

  /* "bpf4/core.pyx":4449
 * 
 * cdef class _BpfLambdaEqualConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] == b
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4455
 * 
 * cdef class _BpfLambdaUnequal(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] != B[i]
 */

static void __pyx_f_4bpf4_4core_17_BpfLambdaUnequal__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaUnequal *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_B, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4456
 * cdef class _BpfLambdaUnequal(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] != B[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4457
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:
 *         for i in range(n):
 *             A[i] = A[i] != B[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_A[__pyx_v_i]) != (__pyx_v_B[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4455
 * 
 * cdef class _BpfLambdaUnequal(_BpfBinOp):
 *     cdef void _apply(self, DTYPE_t *A, DTYPE_t *B, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] != B[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4461
 * 
 * cdef class _BpfLambdaUnequalConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] != b
 */

static void __pyx_f_4bpf4_4core_22_BpfLambdaUnequalConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaUnequalConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4462
 * cdef class _BpfLambdaUnequalConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = A[i] != b
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4463
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] = A[i] != b             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((__pyx_v_A[__pyx_v_i]) != __pyx_v_b);
  }

  /* "bpf4/core.pyx":4461
 * 
 * cdef class _BpfLambdaUnequalConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = A[i] != b
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4467
 * 
 * cdef class _BpfMaxConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         cdef double y
 *         for i in range(n):
 */

static void __pyx_f_4bpf4_4core_12_BpfMaxConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfMaxConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  double __pyx_v_y;
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  double __pyx_t_4;

  /* "bpf4/core.pyx":4469
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         cdef double y
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             y = A[i]
 *             A[i] = y if y > b else b
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4470
 *         cdef double y
 *         for i in range(n):
 *             y = A[i]             # <<<<<<<<<<<<<<
 *             A[i] = y if y > b else b
 * 
 */
    __pyx_v_y = (__pyx_v_A[__pyx_v_i]);

    /* "bpf4/core.pyx":4471
 *         for i in range(n):
 *             y = A[i]
 *             A[i] = y if y > b else b             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (((__pyx_v_y > __pyx_v_b) != 0)) {
      __pyx_t_4 = __pyx_v_y;
    } else {
      __pyx_t_4 = __pyx_v_b;
    }
    (__pyx_v_A[__pyx_v_i]) = __pyx_t_4;
  }

  /* "bpf4/core.pyx":4467
 * 
 * cdef class _BpfMaxConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         cdef double y
 *         for i in range(n):
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4475
 * 
 * cdef class _BpfMinConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         cdef double y
 *         for i in range(n):
 */

static void __pyx_f_4bpf4_4core_12_BpfMinConst__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfMinConst *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  double __pyx_v_y;
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  double __pyx_t_4;

  /* "bpf4/core.pyx":4477
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         cdef double y
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             y = A[i]
 *             A[i] = y if y < b else b
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4478
 *         cdef double y
 *         for i in range(n):
 *             y = A[i]             # <<<<<<<<<<<<<<
 *             A[i] = y if y < b else b
 * 
 */
    __pyx_v_y = (__pyx_v_A[__pyx_v_i]);

    /* "bpf4/core.pyx":4479
 *         for i in range(n):
 *             y = A[i]
 *             A[i] = y if y < b else b             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (((__pyx_v_y < __pyx_v_b) != 0)) {
      __pyx_t_4 = __pyx_v_y;
    } else {
      __pyx_t_4 = __pyx_v_b;
    }
    (__pyx_v_A[__pyx_v_i]) = __pyx_t_4;
  }

  /* "bpf4/core.pyx":4475
 * 
 * cdef class _BpfMinConst(_BpfBinOpConst):
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         cdef double y
 *         for i in range(n):
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4483
 * 
 * cdef class _BpfLambdaLog(_BpfBinOpConst):
 *     def __init__(_BpfBinOpConst self, BpfInterface a, double b, tuple bounds, str op=''):             # <<<<<<<<<<<<<<
 *         _BpfBinOpConst.__init__(self, a, b, bounds, op)
 *         self.b_const = m_log(b)
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_13_BpfLambdaLog_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_13_BpfLambdaLog_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a = 0;
  double __pyx_v_b;
  PyObject *__pyx_v_bounds = 0;
  PyObject *__pyx_v_op = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_bounds,&__pyx_n_s_op,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject*)__pyx_kp_u__6);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 4483, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 4483, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 4483, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
    __pyx_v_b = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_b == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4483, __pyx_L3_error)
    __pyx_v_bounds = ((PyObject*)values[2]);
    __pyx_v_op = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4483, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfLambdaLog.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "a", 0))) __PYX_ERR(0, 4483, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bounds), (&PyTuple_Type), 1, "bounds", 1))) __PYX_ERR(0, 4483, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), (&PyUnicode_Type), 1, "op", 1))) __PYX_ERR(0, 4483, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfLambdaLog___init__(((struct __pyx_obj_4bpf4_4core__BpfLambdaLog *)__pyx_v_self), __pyx_v_a, __pyx_v_b, __pyx_v_bounds, __pyx_v_op);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_13_BpfLambdaLog___init__(struct __pyx_obj_4bpf4_4core__BpfLambdaLog *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_a, double __pyx_v_b, PyObject *__pyx_v_bounds, PyObject *__pyx_v_op) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":4484
 * cdef class _BpfLambdaLog(_BpfBinOpConst):
 *     def __init__(_BpfBinOpConst self, BpfInterface a, double b, tuple bounds, str op=''):
 *         _BpfBinOpConst.__init__(self, a, b, bounds, op)             # <<<<<<<<<<<<<<
 *         self.b_const = m_log(b)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core__BpfBinOpConst), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_4, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_a), __pyx_t_3, __pyx_v_bounds, __pyx_v_op};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4484, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_4, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_a), __pyx_t_3, __pyx_v_bounds, __pyx_v_op};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4484, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(((PyObject *)__pyx_v_a));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_a));
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_a));
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_bounds);
    __Pyx_GIVEREF(__pyx_v_bounds);
    PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_bounds);
    __Pyx_INCREF(__pyx_v_op);
    __Pyx_GIVEREF(__pyx_v_op);
    PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_5, __pyx_v_op);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4485
 *     def __init__(_BpfBinOpConst self, BpfInterface a, double b, tuple bounds, str op=''):
 *         _BpfBinOpConst.__init__(self, a, b, bounds, op)
 *         self.b_const = m_log(b)             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
  __pyx_v_self->__pyx_base.b_const = __pyx_f_4bpf4_4core_m_log(__pyx_v_b);

  /* "bpf4/core.pyx":4483
 * 
 * cdef class _BpfLambdaLog(_BpfBinOpConst):
 *     def __init__(_BpfBinOpConst self, BpfInterface a, double b, tuple bounds, str op=''):             # <<<<<<<<<<<<<<
 *         _BpfBinOpConst.__init__(self, a, b, bounds, op)
 *         self.b_const = m_log(b)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaLog.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4488
 * 
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = m_log(A[i]) / b
 */

static void __pyx_f_4bpf4_4core_13_BpfLambdaLog__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaLog *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n, double __pyx_v_b) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4489
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = m_log(A[i]) / b
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4490
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:
 *         for i in range(n):
 *             A[i] = m_log(A[i]) / b             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = (__pyx_f_4bpf4_4core_m_log((__pyx_v_A[__pyx_v_i])) / __pyx_v_b);
  }

  /* "bpf4/core.pyx":4488
 * 
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n, double b) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = m_log(A[i]) / b
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4494
 * 
 * cdef class _BpfLambdaRound(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = floor(A[i] + 0.5)
 */

static void __pyx_f_4bpf4_4core_15_BpfLambdaRound__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfLambdaRound *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4495
 * cdef class _BpfLambdaRound(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = floor(A[i] + 0.5)
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4496
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 *             A[i] = floor(A[i] + 0.5)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = floor(((__pyx_v_A[__pyx_v_i]) + 0.5));
  }

  /* "bpf4/core.pyx":4494
 * 
 * cdef class _BpfLambdaRound(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = floor(A[i] + 0.5)
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4501
 * cdef class _BpfRand(_BpfUnaryOp):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = (rand()/<double>RAND_MAX) * A[i]
 */

static void __pyx_f_4bpf4_4core_8_BpfRand__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfRand *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4502
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = (rand()/<double>RAND_MAX) * A[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4503
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 *             A[i] = (rand()/<double>RAND_MAX) * A[i]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = ((((double)rand()) / ((double)RAND_MAX)) * (__pyx_v_A[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4501
 * cdef class _BpfRand(_BpfUnaryOp):
 *     @cython.cdivision(True)
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = (rand()/<double>RAND_MAX) * A[i]
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4507
 * 
 * cdef class _BpfM2F(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = m2f(A[i])
 */

static void __pyx_f_4bpf4_4core_7_BpfM2F__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfM2F *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4508
 * cdef class _BpfM2F(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = m2f(A[i])
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4509
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 *             A[i] = m2f(A[i])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = __pyx_f_4bpf4_4core_m2f((__pyx_v_A[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4507
 * 
 * cdef class _BpfM2F(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = m2f(A[i])
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4513
 * 
 * cdef class _BpfF2M(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = f2m(A[i])
 */

static void __pyx_f_4bpf4_4core_7_BpfF2M__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__BpfF2M *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4514
 * cdef class _BpfF2M(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = f2m(A[i])
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4515
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 *             A[i] = f2m(A[i])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = __pyx_f_4bpf4_4core_f2m((__pyx_v_A[__pyx_v_i]));
  }

  /* "bpf4/core.pyx":4513
 * 
 * cdef class _BpfF2M(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = f2m(A[i])
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4519
 * 
 * cdef class _Bpf_db2amp(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = 10.0 ** (0.05*A[i])
 */

static void __pyx_f_4bpf4_4core_11_Bpf_db2amp__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__Bpf_db2amp *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4520
 * cdef class _Bpf_db2amp(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             A[i] = 10.0 ** (0.05*A[i])
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4521
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         for i in range(n):
 *             A[i] = 10.0 ** (0.05*A[i])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = pow(((__pyx_t_4bpf4_4core_DTYPE_t)10.0), (0.05 * (__pyx_v_A[__pyx_v_i])));
  }

  /* "bpf4/core.pyx":4519
 * 
 * cdef class _Bpf_db2amp(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             A[i] = 10.0 ** (0.05*A[i])
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4525
 * 
 * cdef class _Bpf_amp2db(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         cdef double x
 *         for i in range(n):
 */

static void __pyx_f_4bpf4_4core_11_Bpf_amp2db__apply(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__Bpf_amp2db *__pyx_v_self, __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_A, int __pyx_v_n) {
  double __pyx_v_x;
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  double __pyx_t_4;
  __pyx_t_4bpf4_4core_DTYPE_t __pyx_t_5;
  __pyx_t_4bpf4_4core_DTYPE_t __pyx_t_6;

  /* "bpf4/core.pyx":4527
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:
 *         cdef double x
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             x = max(A[i], 1e-14)
 *             A[i] = log10(x) * 20.0
 */
  __pyx_t_1 = __pyx_v_n;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "bpf4/core.pyx":4528
 *         cdef double x
 *         for i in range(n):
 *             x = max(A[i], 1e-14)             # <<<<<<<<<<<<<<
 *             A[i] = log10(x) * 20.0
 * 
 */
    __pyx_t_4 = 1e-14;
    __pyx_t_5 = (__pyx_v_A[__pyx_v_i]);
    if (((__pyx_t_4 > __pyx_t_5) != 0)) {
      __pyx_t_6 = __pyx_t_4;
    } else {
      __pyx_t_6 = __pyx_t_5;
    }
    __pyx_v_x = __pyx_t_6;

    /* "bpf4/core.pyx":4529
 *         for i in range(n):
 *             x = max(A[i], 1e-14)
 *             A[i] = log10(x) * 20.0             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_A[__pyx_v_i]) = (log10(__pyx_v_x) * 20.0);
  }

  /* "bpf4/core.pyx":4525
 * 
 * cdef class _Bpf_amp2db(_BpfUnaryOp):
 *     cdef void _apply(self, DTYPE_t *A, int n) nogil:             # <<<<<<<<<<<<<<
 *         cdef double x
 *         for i in range(n):
 */

  /* function exit code */
}

/* "bpf4/core.pyx":4535
 *     cdef BpfInterface bpf
 *     cdef double y0, y1
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double y = self.bpf.__ccall__(x)
 *         if y > self.y1:
 */

static double __pyx_f_4bpf4_4core_14_BpfLambdaClip___ccall__(struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_y;
  double __pyx_r;
  int __pyx_t_1;

  /* "bpf4/core.pyx":4536
 *     cdef double y0, y1
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double y = self.bpf.__ccall__(x)             # <<<<<<<<<<<<<<
 *         if y > self.y1:
 *             return self.y1
 */
  __pyx_v_y = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x);

  /* "bpf4/core.pyx":4537
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double y = self.bpf.__ccall__(x)
 *         if y > self.y1:             # <<<<<<<<<<<<<<
 *             return self.y1
 *         elif y < self.y0:
 */
  __pyx_t_1 = ((__pyx_v_y > __pyx_v_self->y1) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":4538
 *         cdef double y = self.bpf.__ccall__(x)
 *         if y > self.y1:
 *             return self.y1             # <<<<<<<<<<<<<<
 *         elif y < self.y0:
 *             return self.y0
 */
    __pyx_r = __pyx_v_self->y1;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4537
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double y = self.bpf.__ccall__(x)
 *         if y > self.y1:             # <<<<<<<<<<<<<<
 *             return self.y1
 *         elif y < self.y0:
 */
  }

  /* "bpf4/core.pyx":4539
 *         if y > self.y1:
 *             return self.y1
 *         elif y < self.y0:             # <<<<<<<<<<<<<<
 *             return self.y0
 *         return y
 */
  __pyx_t_1 = ((__pyx_v_y < __pyx_v_self->y0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":4540
 *             return self.y1
 *         elif y < self.y0:
 *             return self.y0             # <<<<<<<<<<<<<<
 *         return y
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 */
    __pyx_r = __pyx_v_self->y0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4539
 *         if y > self.y1:
 *             return self.y1
 *         elif y < self.y0:             # <<<<<<<<<<<<<<
 *             return self.y0
 *         return y
 */
  }

  /* "bpf4/core.pyx":4541
 *         elif y < self.y0:
 *             return self.y0
 *         return y             # <<<<<<<<<<<<<<
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         cdef:
 */
  __pyx_r = __pyx_v_y;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4535
 *     cdef BpfInterface bpf
 *     cdef double y0, y1
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double y = self.bpf.__ccall__(x)
 *         if y > self.y1:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4542
 *             return self.y0
 *         return y
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ndarray [DTYPE_t, ndim=1] result
 */

static PyObject *__pyx_pw_4bpf4_4core_14_BpfLambdaClip_1mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_14_BpfLambdaClip_mapn_between(struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_14_BpfLambdaClip_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  PyArrayObject *__pyx_v_result = 0;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_data;
  int __pyx_v_i;
  double __pyx_v_dx;
  double __pyx_v_y1;
  double __pyx_v_y0;
  double __pyx_v_y;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
  __Pyx_Buffer __pyx_pybuffer_result;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  int __pyx_t_20;
  int __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  __pyx_pybuffer_result.pybuffer.buf = NULL;
  __pyx_pybuffer_result.refcount = 0;
  __pyx_pybuffernd_result.data = NULL;
  __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_14_BpfLambdaClip_1mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4542, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4542, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4542, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4542, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4542, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4542, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4542, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4542, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4548
 *             int i
 *             # we account for the edge (x1 IS INCLUDED)
 *             double dx = (x1 - x0) / (n - 1)             # <<<<<<<<<<<<<<
 *             double y1 = self.y1
 *             double y0 = self.y0
 */
  __pyx_t_10 = (__pyx_v_x1 - __pyx_v_x0);
  __pyx_t_11 = (__pyx_v_n - 1);
  if (unlikely(__pyx_t_11 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 4548, __pyx_L1_error)
  }
  __pyx_v_dx = (__pyx_t_10 / ((double)__pyx_t_11));

  /* "bpf4/core.pyx":4549
 *             # we account for the edge (x1 IS INCLUDED)
 *             double dx = (x1 - x0) / (n - 1)
 *             double y1 = self.y1             # <<<<<<<<<<<<<<
 *             double y0 = self.y0
 *             double y
 */
  __pyx_t_10 = __pyx_v_self->y1;
  __pyx_v_y1 = __pyx_t_10;

  /* "bpf4/core.pyx":4550
 *             double dx = (x1 - x0) / (n - 1)
 *             double y1 = self.y1
 *             double y0 = self.y0             # <<<<<<<<<<<<<<
 *             double y
 *             BpfInterface bpf = self.bpf
 */
  __pyx_t_10 = __pyx_v_self->y0;
  __pyx_v_y0 = __pyx_t_10;

  /* "bpf4/core.pyx":4552
 *             double y0 = self.y0
 *             double y
 *             BpfInterface bpf = self.bpf             # <<<<<<<<<<<<<<
 *         if out is None:
 *             result = EMPTY1D(n)
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->bpf);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4553
 *             double y
 *             BpfInterface bpf = self.bpf
 *         if out is None:             # <<<<<<<<<<<<<<
 *             result = EMPTY1D(n)
 *             data = <DTYPE_t *>result.data
 */
  __pyx_t_12 = (((PyObject *)__pyx_v_out) == Py_None);
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "bpf4/core.pyx":4554
 *             BpfInterface bpf = self.bpf
 *         if out is None:
 *             result = EMPTY1D(n)             # <<<<<<<<<<<<<<
 *             data = <DTYPE_t *>result.data
 *             with nogil:
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
      __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_8 < 0)) {
        PyErr_Fetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
        }
        __pyx_t_14 = __pyx_t_15 = __pyx_t_16 = 0;
      }
      __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4554, __pyx_L1_error)
    }
    __pyx_v_result = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "bpf4/core.pyx":4555
 *         if out is None:
 *             result = EMPTY1D(n)
 *             data = <DTYPE_t *>result.data             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 for i in range(n):
 */
    __pyx_v_data = ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_result->data);

    /* "bpf4/core.pyx":4556
 *             result = EMPTY1D(n)
 *             data = <DTYPE_t *>result.data
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 for i in range(n):
 *                     y = bpf.__ccall__(x0 + dx * i)
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "bpf4/core.pyx":4557
 *             data = <DTYPE_t *>result.data
 *             with nogil:
 *                 for i in range(n):             # <<<<<<<<<<<<<<
 *                     y = bpf.__ccall__(x0 + dx * i)
 *                     y = _clip(y, y0, y1)
 */
          __pyx_t_8 = __pyx_v_n;
          __pyx_t_17 = __pyx_t_8;
          for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
            __pyx_v_i = __pyx_t_18;

            /* "bpf4/core.pyx":4558
 *             with nogil:
 *                 for i in range(n):
 *                     y = bpf.__ccall__(x0 + dx * i)             # <<<<<<<<<<<<<<
 *                     y = _clip(y, y0, y1)
 *                     data[i] = y
 */
            __pyx_v_y = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_bpf, (__pyx_v_x0 + (__pyx_v_dx * __pyx_v_i)));

            /* "bpf4/core.pyx":4559
 *                 for i in range(n):
 *                     y = bpf.__ccall__(x0 + dx * i)
 *                     y = _clip(y, y0, y1)             # <<<<<<<<<<<<<<
 *                     data[i] = y
 *             return result
 */
            __pyx_v_y = __pyx_f_4bpf4_4core__clip(__pyx_v_y, __pyx_v_y0, __pyx_v_y1);

            /* "bpf4/core.pyx":4560
 *                     y = bpf.__ccall__(x0 + dx * i)
 *                     y = _clip(y, y0, y1)
 *                     data[i] = y             # <<<<<<<<<<<<<<
 *             return result
 *         else:
 */
            (__pyx_v_data[__pyx_v_i]) = __pyx_v_y;
          }
        }

        /* "bpf4/core.pyx":4556
 *             result = EMPTY1D(n)
 *             data = <DTYPE_t *>result.data
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 for i in range(n):
 *                     y = bpf.__ccall__(x0 + dx * i)
 */
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L6:;
        }
    }

    /* "bpf4/core.pyx":4561
 *                     y = _clip(y, y0, y1)
 *                     data[i] = y
 *             return result             # <<<<<<<<<<<<<<
 *         else:
 *             if PyArray_ISCONTIGUOUS(out):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = ((PyArrayObject *)__pyx_v_result);
    goto __pyx_L0;

    /* "bpf4/core.pyx":4553
 *             double y
 *             BpfInterface bpf = self.bpf
 *         if out is None:             # <<<<<<<<<<<<<<
 *             result = EMPTY1D(n)
 *             data = <DTYPE_t *>result.data
 */
  }

  /* "bpf4/core.pyx":4563
 *             return result
 *         else:
 *             if PyArray_ISCONTIGUOUS(out):             # <<<<<<<<<<<<<<
 *                 data = <DTYPE_t *>out.data
 *                 with nogil:
 */
  /*else*/ {
    __pyx_t_13 = (PyArray_ISCONTIGUOUS(__pyx_v_out) != 0);
    if (__pyx_t_13) {

      /* "bpf4/core.pyx":4564
 *         else:
 *             if PyArray_ISCONTIGUOUS(out):
 *                 data = <DTYPE_t *>out.data             # <<<<<<<<<<<<<<
 *                 with nogil:
 *                     for i in range(n):
 */
      __pyx_v_data = ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_out->data);

      /* "bpf4/core.pyx":4565
 *             if PyArray_ISCONTIGUOUS(out):
 *                 data = <DTYPE_t *>out.data
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     for i in range(n):
 *                         y = bpf.__ccall__(x0 + dx * i)
 */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {

            /* "bpf4/core.pyx":4566
 *                 data = <DTYPE_t *>out.data
 *                 with nogil:
 *                     for i in range(n):             # <<<<<<<<<<<<<<
 *                         y = bpf.__ccall__(x0 + dx * i)
 *                         y = _clip(y, y0, y1)
 */
            __pyx_t_8 = __pyx_v_n;
            __pyx_t_17 = __pyx_t_8;
            for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
              __pyx_v_i = __pyx_t_18;

              /* "bpf4/core.pyx":4567
 *                 with nogil:
 *                     for i in range(n):
 *                         y = bpf.__ccall__(x0 + dx * i)             # <<<<<<<<<<<<<<
 *                         y = _clip(y, y0, y1)
 *                         data[i] = y
 */
              __pyx_v_y = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_bpf, (__pyx_v_x0 + (__pyx_v_dx * __pyx_v_i)));

              /* "bpf4/core.pyx":4568
 *                     for i in range(n):
 *                         y = bpf.__ccall__(x0 + dx * i)
 *                         y = _clip(y, y0, y1)             # <<<<<<<<<<<<<<
 *                         data[i] = y
 *             else:
 */
              __pyx_v_y = __pyx_f_4bpf4_4core__clip(__pyx_v_y, __pyx_v_y0, __pyx_v_y1);

              /* "bpf4/core.pyx":4569
 *                         y = bpf.__ccall__(x0 + dx * i)
 *                         y = _clip(y, y0, y1)
 *                         data[i] = y             # <<<<<<<<<<<<<<
 *             else:
 *                 for i in range(n):
 */
              (__pyx_v_data[__pyx_v_i]) = __pyx_v_y;
            }
          }

          /* "bpf4/core.pyx":4565
 *             if PyArray_ISCONTIGUOUS(out):
 *                 data = <DTYPE_t *>out.data
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     for i in range(n):
 *                         y = bpf.__ccall__(x0 + dx * i)
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L12;
            }
            __pyx_L12:;
          }
      }

      /* "bpf4/core.pyx":4563
 *             return result
 *         else:
 *             if PyArray_ISCONTIGUOUS(out):             # <<<<<<<<<<<<<<
 *                 data = <DTYPE_t *>out.data
 *                 with nogil:
 */
      goto __pyx_L9;
    }

    /* "bpf4/core.pyx":4571
 *                         data[i] = y
 *             else:
 *                 for i in range(n):             # <<<<<<<<<<<<<<
 *                     for i in range(n):
 *                         y = bpf.__ccall__(x0 + dx * i)
 */
    /*else*/ {
      __pyx_t_8 = __pyx_v_n;
      __pyx_t_17 = __pyx_t_8;
      for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
        __pyx_v_i = __pyx_t_18;

        /* "bpf4/core.pyx":4572
 *             else:
 *                 for i in range(n):
 *                     for i in range(n):             # <<<<<<<<<<<<<<
 *                         y = bpf.__ccall__(x0 + dx * i)
 *                         y = _clip(y, y0, y1)
 */
        __pyx_t_19 = __pyx_v_n;
        __pyx_t_20 = __pyx_t_19;
        for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
          __pyx_v_i = __pyx_t_21;

          /* "bpf4/core.pyx":4573
 *                 for i in range(n):
 *                     for i in range(n):
 *                         y = bpf.__ccall__(x0 + dx * i)             # <<<<<<<<<<<<<<
 *                         y = _clip(y, y0, y1)
 *                         out[i] = y
 */
          __pyx_v_y = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_bpf, (__pyx_v_x0 + (__pyx_v_dx * __pyx_v_i)));

          /* "bpf4/core.pyx":4574
 *                     for i in range(n):
 *                         y = bpf.__ccall__(x0 + dx * i)
 *                         y = _clip(y, y0, y1)             # <<<<<<<<<<<<<<
 *                         out[i] = y
 *             return out
 */
          __pyx_v_y = __pyx_f_4bpf4_4core__clip(__pyx_v_y, __pyx_v_y0, __pyx_v_y1);

          /* "bpf4/core.pyx":4575
 *                         y = bpf.__ccall__(x0 + dx * i)
 *                         y = _clip(y, y0, y1)
 *                         out[i] = y             # <<<<<<<<<<<<<<
 *             return out
 * 
 */
          __pyx_t_1 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4575, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_out), __pyx_v_i, __pyx_t_1, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 4575, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
      }
    }
    __pyx_L9:;

    /* "bpf4/core.pyx":4576
 *                         y = _clip(y, y0, y1)
 *                         out[i] = y
 *             return out             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = __pyx_v_out;
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":4542
 *             return self.y0
 *         return y
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ndarray [DTYPE_t, ndim=1] result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core._BpfLambdaClip.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_bpf);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfLambdaClip_1mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_14_BpfLambdaClip_mapn_between[] = "_BpfLambdaClip.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray";
static PyMethodDef __pyx_mdef_4bpf4_4core_14_BpfLambdaClip_1mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_14_BpfLambdaClip_1mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_14_BpfLambdaClip_mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_14_BpfLambdaClip_1mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 4542, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 4542, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 4542, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4542, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4542, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4542, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4542, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfLambdaClip.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 4542, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfLambdaClip_mapn_between(((struct __pyx_obj_4bpf4_4core__BpfLambdaClip *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfLambdaClip_mapn_between(struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__BpfLambdaClip->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaClip.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4578
 *             return out
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), (), (self.bpf, self.y0, self.y1)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfLambdaClip_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_14_BpfLambdaClip_2__reduce__[] = "_BpfLambdaClip.__reduce__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_14_BpfLambdaClip_3__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfLambdaClip_3__reduce__, METH_NOARGS, __pyx_doc_4bpf4_4core_14_BpfLambdaClip_2__reduce__};
static PyObject *__pyx_pw_4bpf4_4core_14_BpfLambdaClip_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfLambdaClip_2__reduce__(((struct __pyx_obj_4bpf4_4core__BpfLambdaClip *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfLambdaClip_2__reduce__(struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "bpf4/core.pyx":4579
 * 
 *     def __reduce__(self):
 *         return type(self), (), (self.bpf, self.y0, self.y1)             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->y0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->y1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->bpf));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __Pyx_INCREF(__pyx_empty_tuple);
  __Pyx_GIVEREF(__pyx_empty_tuple);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_empty_tuple);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4578
 *             return out
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), (), (self.bpf, self.y0, self.y1)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaClip.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4581
 *         return type(self), (), (self.bpf, self.y0, self.y1)
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.bpf, self.y0, self.y1 = state
 *         self._set_bounds_like(self.bpf)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfLambdaClip_5__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_4bpf4_4core_14_BpfLambdaClip_4__setstate__[] = "_BpfLambdaClip.__setstate__(self, state)";
static PyMethodDef __pyx_mdef_4bpf4_4core_14_BpfLambdaClip_5__setstate__ = {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfLambdaClip_5__setstate__, METH_O, __pyx_doc_4bpf4_4core_14_BpfLambdaClip_4__setstate__};
static PyObject *__pyx_pw_4bpf4_4core_14_BpfLambdaClip_5__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfLambdaClip_4__setstate__(((struct __pyx_obj_4bpf4_4core__BpfLambdaClip *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfLambdaClip_4__setstate__(struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  double __pyx_t_6;
  double __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "bpf4/core.pyx":4582
 * 
 *     def __setstate__(self, state):
 *         self.bpf, self.y0, self.y1 = state             # <<<<<<<<<<<<<<
 *         self._set_bounds_like(self.bpf)
 * 
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_state))) || (PyList_CheckExact(__pyx_v_state))) {
    PyObject* sequence = __pyx_v_state;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 4582, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_v_state); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) __PYX_ERR(0, 4582, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 4582, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 4582, __pyx_L1_error)
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->bpf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->bpf));
  __pyx_v_self->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_self->y0 = __pyx_t_6;
  __pyx_v_self->y1 = __pyx_t_7;

  /* "bpf4/core.pyx":4583
 *     def __setstate__(self, state):
 *         self.bpf, self.y0, self.y1 = state
 *         self._set_bounds_like(self.bpf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_self->bpf);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds_like(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "bpf4/core.pyx":4581
 *         return type(self), (), (self.bpf, self.y0, self.y1)
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.bpf, self.y0, self.y1 = state
 *         self._set_bounds_like(self.bpf)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaClip.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4586
 * 
 * 
 * cdef _BpfLambdaClip _BpfLambdaClip_new(BpfInterface bpf, double y0, double y1):             # <<<<<<<<<<<<<<
 *     cdef _BpfLambdaClip self = _BpfLambdaClip()
 *     self._set_bounds_like(bpf)
 */

static struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_f_4bpf4_4core__BpfLambdaClip_new(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, double __pyx_v_y0, double __pyx_v_y1) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_v_self = 0;
  struct __pyx_obj_4bpf4_4core__BpfLambdaClip *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_BpfLambdaClip_new", 0);

  /* "bpf4/core.pyx":4587
 * 
 * cdef _BpfLambdaClip _BpfLambdaClip_new(BpfInterface bpf, double y0, double y1):
 *     cdef _BpfLambdaClip self = _BpfLambdaClip()             # <<<<<<<<<<<<<<
 *     self._set_bounds_like(bpf)
 *     self.bpf = bpf
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaClip)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_self = ((struct __pyx_obj_4bpf4_4core__BpfLambdaClip *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4588
 * cdef _BpfLambdaClip _BpfLambdaClip_new(BpfInterface bpf, double y0, double y1):
 *     cdef _BpfLambdaClip self = _BpfLambdaClip()
 *     self._set_bounds_like(bpf)             # <<<<<<<<<<<<<<
 *     self.bpf = bpf
 *     self.y0 = y0
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds_like(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_bpf);

  /* "bpf4/core.pyx":4589
 *     cdef _BpfLambdaClip self = _BpfLambdaClip()
 *     self._set_bounds_like(bpf)
 *     self.bpf = bpf             # <<<<<<<<<<<<<<
 *     self.y0 = y0
 *     self.y1 = y1
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GOTREF(__pyx_v_self->bpf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->bpf));
  __pyx_v_self->bpf = __pyx_v_bpf;

  /* "bpf4/core.pyx":4590
 *     self._set_bounds_like(bpf)
 *     self.bpf = bpf
 *     self.y0 = y0             # <<<<<<<<<<<<<<
 *     self.y1 = y1
 *     return self
 */
  __pyx_v_self->y0 = __pyx_v_y0;

  /* "bpf4/core.pyx":4591
 *     self.bpf = bpf
 *     self.y0 = y0
 *     self.y1 = y1             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
  __pyx_v_self->y1 = __pyx_v_y1;

  /* "bpf4/core.pyx":4592
 *     self.y0 = y0
 *     self.y1 = y1
 *     return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4586
 * 
 * 
 * cdef _BpfLambdaClip _BpfLambdaClip_new(BpfInterface bpf, double y0, double y1):             # <<<<<<<<<<<<<<
 *     cdef _BpfLambdaClip self = _BpfLambdaClip()
 *     self._set_bounds_like(bpf)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfLambdaClip_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4604
 *     cdef double h
 * 
 *     def __init__(self, BpfInterface bpf, double h=0):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_9_BpfDeriv_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_9_BpfDeriv___init__[] = "\n        Args:\n            bpf (BpfInterface): the bpf to take the derivative\n            h (float): the delta x used to calculate the derivative\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_9_BpfDeriv___init__;
#endif
static int __pyx_pw_4bpf4_4core_9_BpfDeriv_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf = 0;
  double __pyx_v_h;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bpf,&__pyx_n_s_h,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 4604, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
    if (values[1]) {
      __pyx_v_h = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_h == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4604, __pyx_L3_error)
    } else {
      __pyx_v_h = ((double)0.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4604, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfDeriv.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bpf), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "bpf", 0))) __PYX_ERR(0, 4604, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_9_BpfDeriv___init__(((struct __pyx_obj_4bpf4_4core__BpfDeriv *)__pyx_v_self), __pyx_v_bpf, __pyx_v_h);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_9_BpfDeriv___init__(struct __pyx_obj_4bpf4_4core__BpfDeriv *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, double __pyx_v_h) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  double __pyx_t_6;
  double __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":4610
 *             h (float): the delta x used to calculate the derivative
 *         """
 *         self.h = h             # <<<<<<<<<<<<<<
 *         self.bpf = bpf
 *         self._x0, self._x1 = bpf.bounds()
 */
  __pyx_v_self->h = __pyx_v_h;

  /* "bpf4/core.pyx":4611
 *         """
 *         self.h = h
 *         self.bpf = bpf             # <<<<<<<<<<<<<<
 *         self._x0, self._x1 = bpf.bounds()
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GOTREF(__pyx_v_self->bpf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->bpf));
  __pyx_v_self->bpf = __pyx_v_bpf;

  /* "bpf4/core.pyx":4612
 *         self.h = h
 *         self.bpf = bpf
 *         self._x0, self._x1 = bpf.bounds()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bpf), __pyx_n_s_bounds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 4612, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 4612, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 4612, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->__pyx_base._x0 = __pyx_t_6;
  __pyx_v_self->__pyx_base._x1 = __pyx_t_7;

  /* "bpf4/core.pyx":4604
 *     cdef double h
 * 
 *     def __init__(self, BpfInterface bpf, double h=0):             # <<<<<<<<<<<<<<
 *         """
 *         Args:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfDeriv.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4616
 * 
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double h = self.h if self.h > 0 else (SQRT_EPS if x == 0 else SQRT_EPS*x)
 *         cdef double xh = x+h
 */

static double __pyx_f_4bpf4_4core_9_BpfDeriv___ccall__(struct __pyx_obj_4bpf4_4core__BpfDeriv *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_h;
  double __pyx_v_xh;
  double __pyx_v_f0;
  double __pyx_v_f1;
  double __pyx_v_x1;
  double __pyx_r;
  double __pyx_t_1;
  double __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "bpf4/core.pyx":4617
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double h = self.h if self.h > 0 else (SQRT_EPS if x == 0 else SQRT_EPS*x)             # <<<<<<<<<<<<<<
 *         cdef double xh = x+h
 *         cdef double f0, f1
 */
  if (((__pyx_v_self->h > 0.0) != 0)) {
    __pyx_t_1 = __pyx_v_self->h;
  } else {
    if (((__pyx_v_x == 0.0) != 0)) {
      __pyx_t_2 = __pyx_v_4bpf4_4core_SQRT_EPS;
    } else {
      __pyx_t_2 = (__pyx_v_4bpf4_4core_SQRT_EPS * __pyx_v_x);
    }
    __pyx_t_1 = __pyx_t_2;
  }
  __pyx_v_h = __pyx_t_1;

  /* "bpf4/core.pyx":4618
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double h = self.h if self.h > 0 else (SQRT_EPS if x == 0 else SQRT_EPS*x)
 *         cdef double xh = x+h             # <<<<<<<<<<<<<<
 *         cdef double f0, f1
 *         cdef double x1 = self._x1
 */
  __pyx_v_xh = (__pyx_v_x + __pyx_v_h);

  /* "bpf4/core.pyx":4620
 *         cdef double xh = x+h
 *         cdef double f0, f1
 *         cdef double x1 = self._x1             # <<<<<<<<<<<<<<
 *         if x <= x1 and xh > x1:
 *             # Prevent discontinuities at the boundaries
 */
  __pyx_t_1 = __pyx_v_self->__pyx_base._x1;
  __pyx_v_x1 = __pyx_t_1;

  /* "bpf4/core.pyx":4621
 *         cdef double f0, f1
 *         cdef double x1 = self._x1
 *         if x <= x1 and xh > x1:             # <<<<<<<<<<<<<<
 *             # Prevent discontinuities at the boundaries
 *             f1 = self.bpf.__ccall__(x1)
 */
  __pyx_t_4 = ((__pyx_v_x <= __pyx_v_x1) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_xh > __pyx_v_x1) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "bpf4/core.pyx":4623
 *         if x <= x1 and xh > x1:
 *             # Prevent discontinuities at the boundaries
 *             f1 = self.bpf.__ccall__(x1)             # <<<<<<<<<<<<<<
 *             f0 = self.bpf.__ccall__(x1-h)
 *         else:
 */
    __pyx_v_f1 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x1);

    /* "bpf4/core.pyx":4624
 *             # Prevent discontinuities at the boundaries
 *             f1 = self.bpf.__ccall__(x1)
 *             f0 = self.bpf.__ccall__(x1-h)             # <<<<<<<<<<<<<<
 *         else:
 *             f1 = self.bpf.__ccall__(x+h)
 */
    __pyx_v_f0 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, (__pyx_v_x1 - __pyx_v_h));

    /* "bpf4/core.pyx":4621
 *         cdef double f0, f1
 *         cdef double x1 = self._x1
 *         if x <= x1 and xh > x1:             # <<<<<<<<<<<<<<
 *             # Prevent discontinuities at the boundaries
 *             f1 = self.bpf.__ccall__(x1)
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":4626
 *             f0 = self.bpf.__ccall__(x1-h)
 *         else:
 *             f1 = self.bpf.__ccall__(x+h)             # <<<<<<<<<<<<<<
 *             f0 = self.bpf.__ccall__(x)
 *         return (f1 - f0) / h
 */
  /*else*/ {
    __pyx_v_f1 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, (__pyx_v_x + __pyx_v_h));

    /* "bpf4/core.pyx":4627
 *         else:
 *             f1 = self.bpf.__ccall__(x+h)
 *             f0 = self.bpf.__ccall__(x)             # <<<<<<<<<<<<<<
 *         return (f1 - f0) / h
 * 
 */
    __pyx_v_f0 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x);
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":4628
 *             f1 = self.bpf.__ccall__(x+h)
 *             f0 = self.bpf.__ccall__(x)
 *         return (f1 - f0) / h             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_r = ((__pyx_v_f1 - __pyx_v_f0) / __pyx_v_h);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4616
 * 
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double h = self.h if self.h > 0 else (SQRT_EPS if x == 0 else SQRT_EPS*x)
 *         cdef double xh = x+h
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4630
 *         return (f1 - f0) / h
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.bpf,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_9_BpfDeriv_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_9_BpfDeriv_2__getstate__[] = "_BpfDeriv.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_9_BpfDeriv_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_9_BpfDeriv_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_9_BpfDeriv_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_9_BpfDeriv_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_9_BpfDeriv_2__getstate__(((struct __pyx_obj_4bpf4_4core__BpfDeriv *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_9_BpfDeriv_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfDeriv *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":4631
 * 
 *     def __getstate__(self):
 *         return (self.bpf,)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->bpf));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->bpf));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4630
 *         return (f1 - f0) / h
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.bpf,)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfDeriv.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4638
 *     cdef double bpf_x0, bpf_x1
 * 
 *     def __init__(self, BpfInterface bpf):             # <<<<<<<<<<<<<<
 *         cdef double x0, x1
 *         self.bpf = bpf
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_12_BpfInverted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_12_BpfInverted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bpf,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 4638, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4638, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfInverted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bpf), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "bpf", 0))) __PYX_ERR(0, 4638, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_12_BpfInverted___init__(((struct __pyx_obj_4bpf4_4core__BpfInverted *)__pyx_v_self), __pyx_v_bpf);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_12_BpfInverted___init__(struct __pyx_obj_4bpf4_4core__BpfInverted *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  double __pyx_t_6;
  double __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":4640
 *     def __init__(self, BpfInterface bpf):
 *         cdef double x0, x1
 *         self.bpf = bpf             # <<<<<<<<<<<<<<
 *         self.bpf_x0, self.bpf_x1 = bpf.bounds()
 *         x0 = bpf(self.bpf_x0)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GOTREF(__pyx_v_self->bpf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->bpf));
  __pyx_v_self->bpf = __pyx_v_bpf;

  /* "bpf4/core.pyx":4641
 *         cdef double x0, x1
 *         self.bpf = bpf
 *         self.bpf_x0, self.bpf_x1 = bpf.bounds()             # <<<<<<<<<<<<<<
 *         x0 = bpf(self.bpf_x0)
 *         x1 = bpf(self.bpf_x1)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bpf), __pyx_n_s_bounds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 4641, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 4641, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 4641, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4641, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4641, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->bpf_x0 = __pyx_t_6;
  __pyx_v_self->bpf_x1 = __pyx_t_7;

  /* "bpf4/core.pyx":4642
 *         self.bpf = bpf
 *         self.bpf_x0, self.bpf_x1 = bpf.bounds()
 *         x0 = bpf(self.bpf_x0)             # <<<<<<<<<<<<<<
 *         x1 = bpf(self.bpf_x1)
 *         if x0 >= x1:
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->bpf_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_bpf));
  __pyx_t_2 = ((PyObject *)__pyx_v_bpf); __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_x0 = __pyx_t_7;

  /* "bpf4/core.pyx":4643
 *         self.bpf_x0, self.bpf_x1 = bpf.bounds()
 *         x0 = bpf(self.bpf_x0)
 *         x1 = bpf(self.bpf_x1)             # <<<<<<<<<<<<<<
 *         if x0 >= x1:
 *             raise BpfInversionError("could not invert bpf")
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->bpf_x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_bpf));
  __pyx_t_3 = ((PyObject *)__pyx_v_bpf); __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4643, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_x1 = __pyx_t_7;

  /* "bpf4/core.pyx":4644
 *         x0 = bpf(self.bpf_x0)
 *         x1 = bpf(self.bpf_x1)
 *         if x0 >= x1:             # <<<<<<<<<<<<<<
 *             raise BpfInversionError("could not invert bpf")
 *         self._set_bounds(x0, x1)
 */
  __pyx_t_8 = ((__pyx_v_x0 >= __pyx_v_x1) != 0);
  if (unlikely(__pyx_t_8)) {

    /* "bpf4/core.pyx":4645
 *         x1 = bpf(self.bpf_x1)
 *         if x0 >= x1:
 *             raise BpfInversionError("could not invert bpf")             # <<<<<<<<<<<<<<
 *         self._set_bounds(x0, x1)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BpfInversionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u_could_not_invert_bpf) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_could_not_invert_bpf);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 4645, __pyx_L1_error)

    /* "bpf4/core.pyx":4644
 *         x0 = bpf(self.bpf_x0)
 *         x1 = bpf(self.bpf_x1)
 *         if x0 >= x1:             # <<<<<<<<<<<<<<
 *             raise BpfInversionError("could not invert bpf")
 *         self._set_bounds(x0, x1)
 */
  }

  /* "bpf4/core.pyx":4646
 *         if x0 >= x1:
 *             raise BpfInversionError("could not invert bpf")
 *         self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":4638
 *     cdef double bpf_x0, bpf_x1
 * 
 *     def __init__(self, BpfInterface bpf):             # <<<<<<<<<<<<<<
 *         cdef double x0, x1
 *         self.bpf = bpf
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfInverted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4648
 *         self._set_bounds(x0, x1)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double out
 *         cdef int outerror, funcalls
 */

static double __pyx_f_4bpf4_4core_12_BpfInverted___ccall__(struct __pyx_obj_4bpf4_4core__BpfInverted *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_out;
  int __pyx_v_outerror;
  int __pyx_v_funcalls;
  double __pyx_r;
  int __pyx_t_1;

  /* "bpf4/core.pyx":4651
 *         cdef double out
 *         cdef int outerror, funcalls
 *         if x < self._x0:             # <<<<<<<<<<<<<<
 *             return self.bpf_x0
 *         elif x > self._x1:
 */
  __pyx_t_1 = ((__pyx_v_x < __pyx_v_self->__pyx_base._x0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":4652
 *         cdef int outerror, funcalls
 *         if x < self._x0:
 *             return self.bpf_x0             # <<<<<<<<<<<<<<
 *         elif x > self._x1:
 *             return self.bpf_x1
 */
    __pyx_r = __pyx_v_self->bpf_x0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4651
 *         cdef double out
 *         cdef int outerror, funcalls
 *         if x < self._x0:             # <<<<<<<<<<<<<<
 *             return self.bpf_x0
 *         elif x > self._x1:
 */
  }

  /* "bpf4/core.pyx":4653
 *         if x < self._x0:
 *             return self.bpf_x0
 *         elif x > self._x1:             # <<<<<<<<<<<<<<
 *             return self.bpf_x1
 *         out = _bpf_brentq(self.bpf, -x, self.bpf_x0, self.bpf_x1, &outerror, BRENTQ_XTOL, BRENTQ_RTOL, BRENTQ_MAXITER, &funcalls)
 */
  __pyx_t_1 = ((__pyx_v_x > __pyx_v_self->__pyx_base._x1) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":4654
 *             return self.bpf_x0
 *         elif x > self._x1:
 *             return self.bpf_x1             # <<<<<<<<<<<<<<
 *         out = _bpf_brentq(self.bpf, -x, self.bpf_x0, self.bpf_x1, &outerror, BRENTQ_XTOL, BRENTQ_RTOL, BRENTQ_MAXITER, &funcalls)
 *         if outerror == 1:   # error
 */
    __pyx_r = __pyx_v_self->bpf_x1;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4653
 *         if x < self._x0:
 *             return self.bpf_x0
 *         elif x > self._x1:             # <<<<<<<<<<<<<<
 *             return self.bpf_x1
 *         out = _bpf_brentq(self.bpf, -x, self.bpf_x0, self.bpf_x1, &outerror, BRENTQ_XTOL, BRENTQ_RTOL, BRENTQ_MAXITER, &funcalls)
 */
  }

  /* "bpf4/core.pyx":4655
 *         elif x > self._x1:
 *             return self.bpf_x1
 *         out = _bpf_brentq(self.bpf, -x, self.bpf_x0, self.bpf_x1, &outerror, BRENTQ_XTOL, BRENTQ_RTOL, BRENTQ_MAXITER, &funcalls)             # <<<<<<<<<<<<<<
 *         if outerror == 1:   # error
 *             return NAN
 */
  __pyx_v_out = __pyx_f_4bpf4_4core__bpf_brentq(__pyx_v_self->bpf, (-__pyx_v_x), __pyx_v_self->bpf_x0, __pyx_v_self->bpf_x1, (&__pyx_v_outerror), 1e-12, 4.440892098500626e-16, 0x64, (&__pyx_v_funcalls));

  /* "bpf4/core.pyx":4656
 *             return self.bpf_x1
 *         out = _bpf_brentq(self.bpf, -x, self.bpf_x0, self.bpf_x1, &outerror, BRENTQ_XTOL, BRENTQ_RTOL, BRENTQ_MAXITER, &funcalls)
 *         if outerror == 1:   # error             # <<<<<<<<<<<<<<
 *             return NAN
 *         return out
 */
  __pyx_t_1 = ((__pyx_v_outerror == 1) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":4657
 *         out = _bpf_brentq(self.bpf, -x, self.bpf_x0, self.bpf_x1, &outerror, BRENTQ_XTOL, BRENTQ_RTOL, BRENTQ_MAXITER, &funcalls)
 *         if outerror == 1:   # error
 *             return NAN             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
    __pyx_r = NAN;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4656
 *             return self.bpf_x1
 *         out = _bpf_brentq(self.bpf, -x, self.bpf_x0, self.bpf_x1, &outerror, BRENTQ_XTOL, BRENTQ_RTOL, BRENTQ_MAXITER, &funcalls)
 *         if outerror == 1:   # error             # <<<<<<<<<<<<<<
 *             return NAN
 *         return out
 */
  }

  /* "bpf4/core.pyx":4658
 *         if outerror == 1:   # error
 *             return NAN
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self): return (self.bpf,)
 */
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4648
 *         self._set_bounds(x0, x1)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double out
 *         cdef int outerror, funcalls
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4660
 *         return out
 * 
 *     def __getstate__(self): return (self.bpf,)             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12_BpfInverted_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12_BpfInverted_2__getstate__[] = "_BpfInverted.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_12_BpfInverted_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_12_BpfInverted_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_12_BpfInverted_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_12_BpfInverted_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12_BpfInverted_2__getstate__(((struct __pyx_obj_4bpf4_4core__BpfInverted *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12_BpfInverted_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfInverted *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->bpf));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->bpf));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfInverted.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4673
 *     cdef public size_t oversample
 * 
 *     def __init__(self, BpfInterface bpf, N=None, bounds=None, double min_N_ratio=0.3,             # <<<<<<<<<<<<<<
 *                  double Nexp=0.8, int oversample=0):
 *         """
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_13_BpfIntegrate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_13_BpfIntegrate___init__[] = "\n        Args:\n            bpf: the bpf to integrate\n            N (int): the number of intervals to integrate\n            bounds (tuple(float, float)): the bounds of this bpf\n            min_N_ratio (float): \077\077\n            Nexp (float): \077\077\n            oversample (int): oversampling index\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_13_BpfIntegrate___init__;
#endif
static int __pyx_pw_4bpf4_4core_13_BpfIntegrate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf = 0;
  PyObject *__pyx_v_N = 0;
  PyObject *__pyx_v_bounds = 0;
  double __pyx_v_min_N_ratio;
  double __pyx_v_Nexp;
  int __pyx_v_oversample;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bpf,&__pyx_n_s_N,&__pyx_n_s_bounds,&__pyx_n_s_min_N_ratio,&__pyx_n_s_Nexp,&__pyx_n_s_oversample,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bounds);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_N_ratio);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Nexp);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_oversample);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 4673, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
    __pyx_v_N = values[1];
    __pyx_v_bounds = values[2];
    if (values[3]) {
      __pyx_v_min_N_ratio = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_N_ratio == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4673, __pyx_L3_error)
    } else {
      __pyx_v_min_N_ratio = ((double)0.3);
    }
    if (values[4]) {
      __pyx_v_Nexp = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_Nexp == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4674, __pyx_L3_error)
    } else {
      __pyx_v_Nexp = ((double)0.8);
    }
    if (values[5]) {
      __pyx_v_oversample = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_oversample == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4674, __pyx_L3_error)
    } else {
      __pyx_v_oversample = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4673, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfIntegrate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bpf), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "bpf", 0))) __PYX_ERR(0, 4673, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfIntegrate___init__(((struct __pyx_obj_4bpf4_4core__BpfIntegrate *)__pyx_v_self), __pyx_v_bpf, __pyx_v_N, __pyx_v_bounds, __pyx_v_min_N_ratio, __pyx_v_Nexp, __pyx_v_oversample);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_13_BpfIntegrate___init__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, PyObject *__pyx_v_N, PyObject *__pyx_v_bounds, double __pyx_v_min_N_ratio, double __pyx_v_Nexp, int __pyx_v_oversample) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_v__N;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  double __pyx_t_9;
  double __pyx_t_10;
  size_t __pyx_t_11;
  size_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_bounds);

  /* "bpf4/core.pyx":4688
 *         cdef BpfInterface tmpbpf
 *         cdef int _N
 *         if bounds is None:             # <<<<<<<<<<<<<<
 *             bounds = bpf.bounds()
 *         _N = N if N is not None else CONFIG['integrate.trapz_intervals']
 */
  __pyx_t_1 = (__pyx_v_bounds == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":4689
 *         cdef int _N
 *         if bounds is None:
 *             bounds = bpf.bounds()             # <<<<<<<<<<<<<<
 *         _N = N if N is not None else CONFIG['integrate.trapz_intervals']
 *         x0, x1 = bounds
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bpf), __pyx_n_s_bounds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_bounds, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "bpf4/core.pyx":4688
 *         cdef BpfInterface tmpbpf
 *         cdef int _N
 *         if bounds is None:             # <<<<<<<<<<<<<<
 *             bounds = bpf.bounds()
 *         _N = N if N is not None else CONFIG['integrate.trapz_intervals']
 */
  }

  /* "bpf4/core.pyx":4690
 *         if bounds is None:
 *             bounds = bpf.bounds()
 *         _N = N if N is not None else CONFIG['integrate.trapz_intervals']             # <<<<<<<<<<<<<<
 *         x0, x1 = bounds
 *         self._set_bounds(x0, x1)
 */
  __pyx_t_2 = (__pyx_v_N != Py_None);
  if ((__pyx_t_2 != 0)) {
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4690, __pyx_L1_error)
    __pyx_t_6 = __pyx_t_7;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CONFIG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_kp_u_integrate_trapz_intervals); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4690, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __pyx_t_7;
  }
  __pyx_v__N = __pyx_t_6;

  /* "bpf4/core.pyx":4691
 *             bounds = bpf.bounds()
 *         _N = N if N is not None else CONFIG['integrate.trapz_intervals']
 *         x0, x1 = bounds             # <<<<<<<<<<<<<<
 *         self._set_bounds(x0, x1)
 *         self.bpf = bpf
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_bounds))) || (PyList_CheckExact(__pyx_v_bounds))) {
    PyObject* sequence = __pyx_v_bounds;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 4691, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_v_bounds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 2) < 0) __PYX_ERR(0, 4691, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 4691, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4691, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4691, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_x0 = __pyx_t_9;
  __pyx_v_x1 = __pyx_t_10;

  /* "bpf4/core.pyx":4692
 *         _N = N if N is not None else CONFIG['integrate.trapz_intervals']
 *         x0, x1 = bounds
 *         self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 *         self.bpf = bpf
 *         self.N = _N
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":4693
 *         x0, x1 = bounds
 *         self._set_bounds(x0, x1)
 *         self.bpf = bpf             # <<<<<<<<<<<<<<
 *         self.N = _N
 *         self.bpf_at_x0 = bpf.__ccall__(x0)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GOTREF(__pyx_v_self->bpf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->bpf));
  __pyx_v_self->bpf = __pyx_v_bpf;

  /* "bpf4/core.pyx":4694
 *         self._set_bounds(x0, x1)
 *         self.bpf = bpf
 *         self.N = _N             # <<<<<<<<<<<<<<
 *         self.bpf_at_x0 = bpf.__ccall__(x0)
 *         self.min_N_ratio = min_N_ratio
 */
  __pyx_v_self->N = __pyx_v__N;

  /* "bpf4/core.pyx":4695
 *         self.bpf = bpf
 *         self.N = _N
 *         self.bpf_at_x0 = bpf.__ccall__(x0)             # <<<<<<<<<<<<<<
 *         self.min_N_ratio = min_N_ratio
 *         self.N0 = <int>(_N * min_N_ratio)
 */
  __pyx_v_self->bpf_at_x0 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_bpf, __pyx_v_x0);

  /* "bpf4/core.pyx":4696
 *         self.N = _N
 *         self.bpf_at_x0 = bpf.__ccall__(x0)
 *         self.min_N_ratio = min_N_ratio             # <<<<<<<<<<<<<<
 *         self.N0 = <int>(_N * min_N_ratio)
 *         self.Nexp = Nexp
 */
  __pyx_v_self->min_N_ratio = __pyx_v_min_N_ratio;

  /* "bpf4/core.pyx":4697
 *         self.bpf_at_x0 = bpf.__ccall__(x0)
 *         self.min_N_ratio = min_N_ratio
 *         self.N0 = <int>(_N * min_N_ratio)             # <<<<<<<<<<<<<<
 *         self.Nexp = Nexp
 *         self.width = x1 - x0
 */
  __pyx_v_self->N0 = ((int)(__pyx_v__N * __pyx_v_min_N_ratio));

  /* "bpf4/core.pyx":4698
 *         self.min_N_ratio = min_N_ratio
 *         self.N0 = <int>(_N * min_N_ratio)
 *         self.Nexp = Nexp             # <<<<<<<<<<<<<<
 *         self.width = x1 - x0
 *         self.Nwidth = _N - self.N0
 */
  __pyx_v_self->Nexp = __pyx_v_Nexp;

  /* "bpf4/core.pyx":4699
 *         self.N0 = <int>(_N * min_N_ratio)
 *         self.Nexp = Nexp
 *         self.width = x1 - x0             # <<<<<<<<<<<<<<
 *         self.Nwidth = _N - self.N0
 *         self.oversample = oversample if oversample > 0 else CONFIG['integrate.oversample']
 */
  __pyx_v_self->width = (__pyx_v_x1 - __pyx_v_x0);

  /* "bpf4/core.pyx":4700
 *         self.Nexp = Nexp
 *         self.width = x1 - x0
 *         self.Nwidth = _N - self.N0             # <<<<<<<<<<<<<<
 *         self.oversample = oversample if oversample > 0 else CONFIG['integrate.oversample']
 *         if x0 == INFNEG or x0 == INF:
 */
  __pyx_v_self->Nwidth = (__pyx_v__N - __pyx_v_self->N0);

  /* "bpf4/core.pyx":4701
 *         self.width = x1 - x0
 *         self.Nwidth = _N - self.N0
 *         self.oversample = oversample if oversample > 0 else CONFIG['integrate.oversample']             # <<<<<<<<<<<<<<
 *         if x0 == INFNEG or x0 == INF:
 *             raise ValueError("cannot integrate a function with an infinite lower bound")
 */
  if (((__pyx_v_oversample > 0) != 0)) {
    __pyx_t_11 = __pyx_v_oversample;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CONFIG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_kp_u_integrate_oversample); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4701, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = __pyx_t_12;
  }
  __pyx_v_self->oversample = __pyx_t_11;

  /* "bpf4/core.pyx":4702
 *         self.Nwidth = _N - self.N0
 *         self.oversample = oversample if oversample > 0 else CONFIG['integrate.oversample']
 *         if x0 == INFNEG or x0 == INF:             # <<<<<<<<<<<<<<
 *             raise ValueError("cannot integrate a function with an infinite lower bound")
 *         self.debug = 0
 */
  __pyx_t_1 = ((__pyx_v_x0 == (-Py_HUGE_VAL)) != 0);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_1 = ((__pyx_v_x0 == Py_HUGE_VAL) != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L7_bool_binop_done:;
  if (unlikely(__pyx_t_2)) {

    /* "bpf4/core.pyx":4703
 *         self.oversample = oversample if oversample > 0 else CONFIG['integrate.oversample']
 *         if x0 == INFNEG or x0 == INF:
 *             raise ValueError("cannot integrate a function with an infinite lower bound")             # <<<<<<<<<<<<<<
 *         self.debug = 0
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 4703, __pyx_L1_error)

    /* "bpf4/core.pyx":4702
 *         self.Nwidth = _N - self.N0
 *         self.oversample = oversample if oversample > 0 else CONFIG['integrate.oversample']
 *         if x0 == INFNEG or x0 == INF:             # <<<<<<<<<<<<<<
 *             raise ValueError("cannot integrate a function with an infinite lower bound")
 *         self.debug = 0
 */
  }

  /* "bpf4/core.pyx":4704
 *         if x0 == INFNEG or x0 == INF:
 *             raise ValueError("cannot integrate a function with an infinite lower bound")
 *         self.debug = 0             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
  __pyx_v_self->debug = 0;

  /* "bpf4/core.pyx":4673
 *     cdef public size_t oversample
 * 
 *     def __init__(self, BpfInterface bpf, N=None, bounds=None, double min_N_ratio=0.3,             # <<<<<<<<<<<<<<
 *                  double Nexp=0.8, int oversample=0):
 *         """
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core._BpfIntegrate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bounds);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4707
 * 
 *     @cython.cdivision(True)
 *     cdef int get_integration_steps(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         return <int>(self.N0 + pow((x - self._x0) / self.width, self.Nexp) * self.Nwidth)
 * 
 */

static int __pyx_f_4bpf4_4core_13_BpfIntegrate_get_integration_steps(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, double __pyx_v_x) {
  int __pyx_r;

  /* "bpf4/core.pyx":4708
 *     @cython.cdivision(True)
 *     cdef int get_integration_steps(self, double x) nogil:
 *         return <int>(self.N0 + pow((x - self._x0) / self.width, self.Nexp) * self.Nwidth)             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
  __pyx_r = ((int)(__pyx_v_self->N0 + (pow(((__pyx_v_x - __pyx_v_self->__pyx_base._x0) / __pyx_v_self->width), __pyx_v_self->Nexp) * __pyx_v_self->Nwidth)));
  goto __pyx_L0;

  /* "bpf4/core.pyx":4707
 * 
 *     @cython.cdivision(True)
 *     cdef int get_integration_steps(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         return <int>(self.N0 + pow((x - self._x0) / self.width, self.Nexp) * self.Nwidth)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4711
 * 
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         with gil:
 *             return self.bpf.integrate_between(self._x0, x)
 */

static double __pyx_f_4bpf4_4core_13_BpfIntegrate___ccall__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, double __pyx_v_x) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("__ccall__", 0);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif

  /* "bpf4/core.pyx":4712
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:
 *         with gil:             # <<<<<<<<<<<<<<
 *             return self.bpf.integrate_between(self._x0, x)
 * 
 */
  /*try:*/ {
    {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
        #endif
        /*try:*/ {

          /* "bpf4/core.pyx":4713
 *     cdef double __ccall__(self, double x) nogil:
 *         with gil:
 *             return self.bpf.integrate_between(self._x0, x)             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
          __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->integrate_between(__pyx_v_self->bpf, __pyx_v_self->__pyx_base._x0, __pyx_v_x, 0, NULL);
          goto __pyx_L6_return;
        }

        /* "bpf4/core.pyx":4712
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:
 *         with gil:             # <<<<<<<<<<<<<<
 *             return self.bpf.integrate_between(self._x0, x)
 * 
 */
        /*finally:*/ {
          __pyx_L6_return: {
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            goto __pyx_L3_return;
          }
        }
    }
  }
  /*finally:*/ {
    __pyx_L3_return: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L0;
    }
  }

  /* "bpf4/core.pyx":4711
 * 
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         with gil:
 *             return self.bpf.integrate_between(self._x0, x)
 */

  /* function exit code */
  __pyx_r = 0;
  __pyx_L0:;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "bpf4/core.pyx":4716
 * 
 *     @cython.cdivision(True)
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef double [::1] accums
 *         cdef double dx0, dx1, dy
 */

static PyObject *__pyx_pw_4bpf4_4core_13_BpfIntegrate_3mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_13_BpfIntegrate_mapn_between(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_13_BpfIntegrate_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  __Pyx_memviewslice __pyx_v_accums = { 0, 0, { 0 }, { 0 }, { 0 } };
  double __pyx_v_dx0;
  double __pyx_v_dx1;
  double __pyx_v_dy;
  double __pyx_v_dx;
  int __pyx_v_i;
  int __pyx_v_return_out;
  double __pyx_v_accum;
  size_t __pyx_v_subn;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  size_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_13_BpfIntegrate_3mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4716, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4716, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4716, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4716, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4716, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4716, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4716, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4716, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4719
 *         cdef double [::1] accums
 *         cdef double dx0, dx1, dy
 *         cdef double dx = (x1 - x0) / (n-1)             # <<<<<<<<<<<<<<
 *         cdef int i, return_out
 *         cdef double accum = self.bpf.integrate_between(self._x0, x0) if x0 > self._x0 else self.__ccall__(self._x0)
 */
  __pyx_v_dx = ((__pyx_v_x1 - __pyx_v_x0) / ((double)(__pyx_v_n - 1)));

  /* "bpf4/core.pyx":4721
 *         cdef double dx = (x1 - x0) / (n-1)
 *         cdef int i, return_out
 *         cdef double accum = self.bpf.integrate_between(self._x0, x0) if x0 > self._x0 else self.__ccall__(self._x0)             # <<<<<<<<<<<<<<
 *         cdef size_t subn = self.oversample
 *         if out is not None and out.shape[0] == n and PyArray_ISCONTIGUOUS(out):
 */
  if (((__pyx_v_x0 > __pyx_v_self->__pyx_base._x0) != 0)) {
    __pyx_t_10 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->integrate_between(__pyx_v_self->bpf, __pyx_v_self->__pyx_base._x0, __pyx_v_x0, 0, NULL);
  } else {
    __pyx_t_10 = ((struct __pyx_vtabstruct_4bpf4_4core__BpfIntegrate *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___ccall__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_self->__pyx_base._x0);
  }
  __pyx_v_accum = __pyx_t_10;

  /* "bpf4/core.pyx":4722
 *         cdef int i, return_out
 *         cdef double accum = self.bpf.integrate_between(self._x0, x0) if x0 > self._x0 else self.__ccall__(self._x0)
 *         cdef size_t subn = self.oversample             # <<<<<<<<<<<<<<
 *         if out is not None and out.shape[0] == n and PyArray_ISCONTIGUOUS(out):
 *             accums = out
 */
  __pyx_t_11 = __pyx_v_self->oversample;
  __pyx_v_subn = __pyx_t_11;

  /* "bpf4/core.pyx":4723
 *         cdef double accum = self.bpf.integrate_between(self._x0, x0) if x0 > self._x0 else self.__ccall__(self._x0)
 *         cdef size_t subn = self.oversample
 *         if out is not None and out.shape[0] == n and PyArray_ISCONTIGUOUS(out):             # <<<<<<<<<<<<<<
 *             accums = out
 *             return_out = 1
 */
  __pyx_t_13 = (((PyObject *)__pyx_v_out) != Py_None);
  __pyx_t_14 = (__pyx_t_13 != 0);
  if (__pyx_t_14) {
  } else {
    __pyx_t_12 = __pyx_t_14;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_14 = (((__pyx_v_out->dimensions[0]) == __pyx_v_n) != 0);
  if (__pyx_t_14) {
  } else {
    __pyx_t_12 = __pyx_t_14;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_14 = (PyArray_ISCONTIGUOUS(__pyx_v_out) != 0);
  __pyx_t_12 = __pyx_t_14;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_12) {

    /* "bpf4/core.pyx":4724
 *         cdef size_t subn = self.oversample
 *         if out is not None and out.shape[0] == n and PyArray_ISCONTIGUOUS(out):
 *             accums = out             # <<<<<<<<<<<<<<
 *             return_out = 1
 *         else:
 */
    __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(((PyObject *)__pyx_v_out), PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 4724, __pyx_L1_error)
    __pyx_v_accums = __pyx_t_15;
    __pyx_t_15.memview = NULL;
    __pyx_t_15.data = NULL;

    /* "bpf4/core.pyx":4725
 *         if out is not None and out.shape[0] == n and PyArray_ISCONTIGUOUS(out):
 *             accums = out
 *             return_out = 1             # <<<<<<<<<<<<<<
 *         else:
 *             accums = EMPTY1D(n)
 */
    __pyx_v_return_out = 1;

    /* "bpf4/core.pyx":4723
 *         cdef double accum = self.bpf.integrate_between(self._x0, x0) if x0 > self._x0 else self.__ccall__(self._x0)
 *         cdef size_t subn = self.oversample
 *         if out is not None and out.shape[0] == n and PyArray_ISCONTIGUOUS(out):             # <<<<<<<<<<<<<<
 *             accums = out
 *             return_out = 1
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":4727
 *             return_out = 1
 *         else:
 *             accums = EMPTY1D(n)             # <<<<<<<<<<<<<<
 *             return_out = 0
 *         accums[0] = accum
 */
  /*else*/ {
    __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 4727, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_accums = __pyx_t_15;
    __pyx_t_15.memview = NULL;
    __pyx_t_15.data = NULL;

    /* "bpf4/core.pyx":4728
 *         else:
 *             accums = EMPTY1D(n)
 *             return_out = 0             # <<<<<<<<<<<<<<
 *         accums[0] = accum
 *         for i in range(1, n):
 */
    __pyx_v_return_out = 0;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":4729
 *             accums = EMPTY1D(n)
 *             return_out = 0
 *         accums[0] = accum             # <<<<<<<<<<<<<<
 *         for i in range(1, n):
 *             dx1 = x0 + i*dx
 */
  __pyx_t_16 = 0;
  *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_accums.data) + __pyx_t_16)) )) = __pyx_v_accum;

  /* "bpf4/core.pyx":4730
 *             return_out = 0
 *         accums[0] = accum
 *         for i in range(1, n):             # <<<<<<<<<<<<<<
 *             dx1 = x0 + i*dx
 *             dx0 = dx1 - dx
 */
  __pyx_t_8 = __pyx_v_n;
  __pyx_t_17 = __pyx_t_8;
  for (__pyx_t_18 = 1; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
    __pyx_v_i = __pyx_t_18;

    /* "bpf4/core.pyx":4731
 *         accums[0] = accum
 *         for i in range(1, n):
 *             dx1 = x0 + i*dx             # <<<<<<<<<<<<<<
 *             dx0 = dx1 - dx
 *             dy = self.bpf.integrate_between(dx0, dx1, subn)
 */
    __pyx_v_dx1 = (__pyx_v_x0 + (__pyx_v_i * __pyx_v_dx));

    /* "bpf4/core.pyx":4732
 *         for i in range(1, n):
 *             dx1 = x0 + i*dx
 *             dx0 = dx1 - dx             # <<<<<<<<<<<<<<
 *             dy = self.bpf.integrate_between(dx0, dx1, subn)
 *             accum += dy
 */
    __pyx_v_dx0 = (__pyx_v_dx1 - __pyx_v_dx);

    /* "bpf4/core.pyx":4733
 *             dx1 = x0 + i*dx
 *             dx0 = dx1 - dx
 *             dy = self.bpf.integrate_between(dx0, dx1, subn)             # <<<<<<<<<<<<<<
 *             accum += dy
 *             accums[i] = accum
 */
    __pyx_t_19.__pyx_n = 1;
    __pyx_t_19.N = __pyx_v_subn;
    __pyx_t_10 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->integrate_between(__pyx_v_self->bpf, __pyx_v_dx0, __pyx_v_dx1, 0, &__pyx_t_19); 
    __pyx_v_dy = __pyx_t_10;

    /* "bpf4/core.pyx":4734
 *             dx0 = dx1 - dx
 *             dy = self.bpf.integrate_between(dx0, dx1, subn)
 *             accum += dy             # <<<<<<<<<<<<<<
 *             accums[i] = accum
 *         if return_out:
 */
    __pyx_v_accum = (__pyx_v_accum + __pyx_v_dy);

    /* "bpf4/core.pyx":4735
 *             dy = self.bpf.integrate_between(dx0, dx1, subn)
 *             accum += dy
 *             accums[i] = accum             # <<<<<<<<<<<<<<
 *         if return_out:
 *             return out
 */
    __pyx_t_16 = __pyx_v_i;
    *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_accums.data) + __pyx_t_16)) )) = __pyx_v_accum;
  }

  /* "bpf4/core.pyx":4736
 *             accum += dy
 *             accums[i] = accum
 *         if return_out:             # <<<<<<<<<<<<<<
 *             return out
 *         else:
 */
  __pyx_t_12 = (__pyx_v_return_out != 0);
  if (__pyx_t_12) {

    /* "bpf4/core.pyx":4737
 *             accums[i] = accum
 *         if return_out:
 *             return out             # <<<<<<<<<<<<<<
 *         else:
 *             return numpy.asarray(accums)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = __pyx_v_out;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4736
 *             accum += dy
 *             accums[i] = accum
 *         if return_out:             # <<<<<<<<<<<<<<
 *             return out
 *         else:
 */
  }

  /* "bpf4/core.pyx":4739
 *             return out
 *         else:
 *             return numpy.asarray(accums)             # <<<<<<<<<<<<<<
 * 
 *     cpdef BpfInterface derivative(self):
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_accums, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4739, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":4716
 * 
 *     @cython.cdivision(True)
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef double [::1] accums
 *         cdef double dx0, dx1, dy
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1);
  __Pyx_AddTraceback("bpf4.core._BpfIntegrate.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XDEC_MEMVIEW(&__pyx_v_accums, 1);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_BpfIntegrate_3mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_13_BpfIntegrate_2mapn_between[] = "_BpfIntegrate.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray";
static PyMethodDef __pyx_mdef_4bpf4_4core_13_BpfIntegrate_3mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_13_BpfIntegrate_3mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_13_BpfIntegrate_2mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_13_BpfIntegrate_3mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 4716, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 4716, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 4716, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4716, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4716, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4716, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4716, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfIntegrate.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 4716, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfIntegrate_2mapn_between(((struct __pyx_obj_4bpf4_4core__BpfIntegrate *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_BpfIntegrate_2mapn_between(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__BpfIntegrate->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfIntegrate.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4741
 *             return numpy.asarray(accums)
 * 
 *     cpdef BpfInterface derivative(self):             # <<<<<<<<<<<<<<
 *         return self.bpf
 * 
 */

static PyObject *__pyx_pw_4bpf4_4core_13_BpfIntegrate_5derivative(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_13_BpfIntegrate_derivative(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("derivative", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_derivative); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_13_BpfIntegrate_5derivative)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 4741, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4742
 * 
 *     cpdef BpfInterface derivative(self):
 *         return self.bpf             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self->bpf));
  __pyx_r = __pyx_v_self->bpf;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4741
 *             return numpy.asarray(accums)
 * 
 *     cpdef BpfInterface derivative(self):             # <<<<<<<<<<<<<<
 *         return self.bpf
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfIntegrate.derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_BpfIntegrate_5derivative(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_13_BpfIntegrate_4derivative[] = "_BpfIntegrate.derivative(self) -> BpfInterface";
static PyMethodDef __pyx_mdef_4bpf4_4core_13_BpfIntegrate_5derivative = {"derivative", (PyCFunction)__pyx_pw_4bpf4_4core_13_BpfIntegrate_5derivative, METH_NOARGS, __pyx_doc_4bpf4_4core_13_BpfIntegrate_4derivative};
static PyObject *__pyx_pw_4bpf4_4core_13_BpfIntegrate_5derivative(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("derivative (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfIntegrate_4derivative(((struct __pyx_obj_4bpf4_4core__BpfIntegrate *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_BpfIntegrate_4derivative(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("derivative", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_13_BpfIntegrate_derivative(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfIntegrate.derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4744
 *         return self.bpf
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.bpf, self.N, self.bounds(), self.min_N_ratio, self.Nexp)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_BpfIntegrate_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_13_BpfIntegrate_6__getstate__[] = "_BpfIntegrate.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_13_BpfIntegrate_7__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_13_BpfIntegrate_7__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_13_BpfIntegrate_6__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_13_BpfIntegrate_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfIntegrate_6__getstate__(((struct __pyx_obj_4bpf4_4core__BpfIntegrate *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_BpfIntegrate_6__getstate__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "bpf4/core.pyx":4745
 * 
 *     def __getstate__(self):
 *         return (self.bpf, self.N, self.bounds(), self.min_N_ratio, self.Nexp)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bounds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->min_N_ratio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->Nexp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->bpf));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4744
 *         return self.bpf
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.bpf, self.N, self.bounds(), self.min_N_ratio, self.Nexp)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core._BpfIntegrate.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4670
 *     cdef double bpf_at_x0, width, min_N_ratio, Nexp
 *     cdef int N, N0, Nwidth
 *     cdef public int debug             # <<<<<<<<<<<<<<
 *     cdef public size_t oversample
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_BpfIntegrate_5debug_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_13_BpfIntegrate_5debug_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfIntegrate_5debug___get__(((struct __pyx_obj_4bpf4_4core__BpfIntegrate *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_BpfIntegrate_5debug___get__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->debug); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfIntegrate.debug.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_13_BpfIntegrate_5debug_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4bpf4_4core_13_BpfIntegrate_5debug_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfIntegrate_5debug_2__set__(((struct __pyx_obj_4bpf4_4core__BpfIntegrate *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_13_BpfIntegrate_5debug_2__set__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4670, __pyx_L1_error)
  __pyx_v_self->debug = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core._BpfIntegrate.debug.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4671
 *     cdef int N, N0, Nwidth
 *     cdef public int debug
 *     cdef public size_t oversample             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, BpfInterface bpf, N=None, bounds=None, double min_N_ratio=0.3,
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_BpfIntegrate_10oversample_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_13_BpfIntegrate_10oversample_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfIntegrate_10oversample___get__(((struct __pyx_obj_4bpf4_4core__BpfIntegrate *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_BpfIntegrate_10oversample___get__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->oversample); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfIntegrate.oversample.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_13_BpfIntegrate_10oversample_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_4bpf4_4core_13_BpfIntegrate_10oversample_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfIntegrate_10oversample_2__set__(((struct __pyx_obj_4bpf4_4core__BpfIntegrate *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_13_BpfIntegrate_10oversample_2__set__(struct __pyx_obj_4bpf4_4core__BpfIntegrate *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4671, __pyx_L1_error)
  __pyx_v_self->oversample = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bpf4.core._BpfIntegrate.oversample.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4753
 *     cdef double period
 * 
 *     def __init__(self, BpfInterface bpf):             # <<<<<<<<<<<<<<
 *         self._set_bounds(INFNEG, INF)
 *         self.bpf = bpf
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_12_BpfPeriodic_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_12_BpfPeriodic_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bpf,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 4753, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4753, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfPeriodic.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bpf), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "bpf", 0))) __PYX_ERR(0, 4753, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_12_BpfPeriodic___init__(((struct __pyx_obj_4bpf4_4core__BpfPeriodic *)__pyx_v_self), __pyx_v_bpf);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_12_BpfPeriodic___init__(struct __pyx_obj_4bpf4_4core__BpfPeriodic *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  double __pyx_t_6;
  double __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":4754
 * 
 *     def __init__(self, BpfInterface bpf):
 *         self._set_bounds(INFNEG, INF)             # <<<<<<<<<<<<<<
 *         self.bpf = bpf
 *         cdef double x0, x1
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), (-Py_HUGE_VAL), Py_HUGE_VAL);

  /* "bpf4/core.pyx":4755
 *     def __init__(self, BpfInterface bpf):
 *         self._set_bounds(INFNEG, INF)
 *         self.bpf = bpf             # <<<<<<<<<<<<<<
 *         cdef double x0, x1
 *         x0, x1 = bpf.bounds()
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GOTREF(__pyx_v_self->bpf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->bpf));
  __pyx_v_self->bpf = __pyx_v_bpf;

  /* "bpf4/core.pyx":4757
 *         self.bpf = bpf
 *         cdef double x0, x1
 *         x0, x1 = bpf.bounds()             # <<<<<<<<<<<<<<
 *         self.x0 = x0
 *         self.period = x1 - x0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_bpf), __pyx_n_s_bounds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 4757, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 4757, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 4757, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4757, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4757, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_x0 = __pyx_t_6;
  __pyx_v_x1 = __pyx_t_7;

  /* "bpf4/core.pyx":4758
 *         cdef double x0, x1
 *         x0, x1 = bpf.bounds()
 *         self.x0 = x0             # <<<<<<<<<<<<<<
 *         self.period = x1 - x0
 * 
 */
  __pyx_v_self->x0 = __pyx_v_x0;

  /* "bpf4/core.pyx":4759
 *         x0, x1 = bpf.bounds()
 *         self.x0 = x0
 *         self.period = x1 - x0             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
  __pyx_v_self->period = (__pyx_v_x1 - __pyx_v_x0);

  /* "bpf4/core.pyx":4753
 *     cdef double period
 * 
 *     def __init__(self, BpfInterface bpf):             # <<<<<<<<<<<<<<
 *         self._set_bounds(INFNEG, INF)
 *         self.bpf = bpf
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._BpfPeriodic.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4762
 * 
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         # the C equivalent of self.x0 + ((x - self.x0) % self.period)
 *         # python n % M | c ((n % M) + M) % M
 */

static double __pyx_f_4bpf4_4core_12_BpfPeriodic___ccall__(struct __pyx_obj_4bpf4_4core__BpfPeriodic *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_n;
  double __pyx_v_p;
  double __pyx_r;

  /* "bpf4/core.pyx":4765
 *         # the C equivalent of self.x0 + ((x - self.x0) % self.period)
 *         # python n % M | c ((n % M) + M) % M
 *         cdef double n = x - self.x0             # <<<<<<<<<<<<<<
 *         cdef double p = self.x0 + ( (n % self.period + self.period) % self.period )
 *         return self.bpf.__ccall__( p )
 */
  __pyx_v_n = (__pyx_v_x - __pyx_v_self->x0);

  /* "bpf4/core.pyx":4766
 *         # python n % M | c ((n % M) + M) % M
 *         cdef double n = x - self.x0
 *         cdef double p = self.x0 + ( (n % self.period + self.period) % self.period )             # <<<<<<<<<<<<<<
 *         return self.bpf.__ccall__( p )
 * 
 */
  __pyx_v_p = (__pyx_v_self->x0 + fmod((fmod(__pyx_v_n, __pyx_v_self->period) + __pyx_v_self->period), __pyx_v_self->period));

  /* "bpf4/core.pyx":4767
 *         cdef double n = x - self.x0
 *         cdef double p = self.x0 + ( (n % self.period + self.period) % self.period )
 *         return self.bpf.__ccall__( p )             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self): return (self.bpf,)
 */
  __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_p);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4762
 * 
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         # the C equivalent of self.x0 + ((x - self.x0) % self.period)
 *         # python n % M | c ((n % M) + M) % M
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4769
 *         return self.bpf.__ccall__( p )
 * 
 *     def __getstate__(self): return (self.bpf,)             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_12_BpfPeriodic_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_12_BpfPeriodic_2__getstate__[] = "_BpfPeriodic.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_12_BpfPeriodic_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_12_BpfPeriodic_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_12_BpfPeriodic_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_12_BpfPeriodic_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_12_BpfPeriodic_2__getstate__(((struct __pyx_obj_4bpf4_4core__BpfPeriodic *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12_BpfPeriodic_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfPeriodic *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->bpf));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->bpf));
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfPeriodic.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4777
 *     cdef readonly double dx, rx, offset
 * 
 *     def __init__(self, BpfInterface bpf, double rx, double dx=0, double offset=0, bounds=None):             # <<<<<<<<<<<<<<
 *         """
 *         equation:
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_14_BpfProjection_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_14_BpfProjection___init__[] = "\n        equation:\n\n        x2 = (x - offset) * rx + dx\n        self(x) = bpf(x2)\n\n        stretched 3: rx=3, offset=0, dx=0\n        shifted 2: rx=1, offset=0, dx=1\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_14_BpfProjection___init__;
#endif
static int __pyx_pw_4bpf4_4core_14_BpfProjection_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf = 0;
  double __pyx_v_rx;
  double __pyx_v_dx;
  double __pyx_v_offset;
  PyObject *__pyx_v_bounds = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bpf,&__pyx_n_s_rx,&__pyx_n_s_dx,&__pyx_n_s_offset,&__pyx_n_s_bounds,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 4777, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dx);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bounds);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 4777, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
    __pyx_v_rx = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_rx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4777, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_dx = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dx == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4777, __pyx_L3_error)
    } else {
      __pyx_v_dx = ((double)0.0);
    }
    if (values[3]) {
      __pyx_v_offset = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_offset == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4777, __pyx_L3_error)
    } else {
      __pyx_v_offset = ((double)0.0);
    }
    __pyx_v_bounds = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4777, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfProjection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bpf), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "bpf", 0))) __PYX_ERR(0, 4777, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfProjection___init__(((struct __pyx_obj_4bpf4_4core__BpfProjection *)__pyx_v_self), __pyx_v_bpf, __pyx_v_rx, __pyx_v_dx, __pyx_v_offset, __pyx_v_bounds);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_14_BpfProjection___init__(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, double __pyx_v_rx, double __pyx_v_dx, double __pyx_v_offset, PyObject *__pyx_v_bounds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  double __pyx_t_3;
  double __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":4787
 *         shifted 2: rx=1, offset=0, dx=1
 *         """
 *         self.bpf = bpf             # <<<<<<<<<<<<<<
 *         self.rx = rx
 *         self.dx = dx
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GOTREF(__pyx_v_self->bpf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->bpf));
  __pyx_v_self->bpf = __pyx_v_bpf;

  /* "bpf4/core.pyx":4788
 *         """
 *         self.bpf = bpf
 *         self.rx = rx             # <<<<<<<<<<<<<<
 *         self.dx = dx
 *         self.offset = offset
 */
  __pyx_v_self->rx = __pyx_v_rx;

  /* "bpf4/core.pyx":4789
 *         self.bpf = bpf
 *         self.rx = rx
 *         self.dx = dx             # <<<<<<<<<<<<<<
 *         self.offset = offset
 *         cdef double x0, x1
 */
  __pyx_v_self->dx = __pyx_v_dx;

  /* "bpf4/core.pyx":4790
 *         self.rx = rx
 *         self.dx = dx
 *         self.offset = offset             # <<<<<<<<<<<<<<
 *         cdef double x0, x1
 *         if bounds:
 */
  __pyx_v_self->offset = __pyx_v_offset;

  /* "bpf4/core.pyx":4792
 *         self.offset = offset
 *         cdef double x0, x1
 *         if bounds:             # <<<<<<<<<<<<<<
 *             self._set_bounds(bounds[0], bounds[1])
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_bounds); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 4792, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":4793
 *         cdef double x0, x1
 *         if bounds:
 *             self._set_bounds(bounds[0], bounds[1])             # <<<<<<<<<<<<<<
 *         else:
 *             x0 = (bpf._x0 - dx)/rx + offset
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bounds, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4793, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bounds, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4793, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_t_3, __pyx_t_4);

    /* "bpf4/core.pyx":4792
 *         self.offset = offset
 *         cdef double x0, x1
 *         if bounds:             # <<<<<<<<<<<<<<
 *             self._set_bounds(bounds[0], bounds[1])
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bpf4/core.pyx":4795
 *             self._set_bounds(bounds[0], bounds[1])
 *         else:
 *             x0 = (bpf._x0 - dx)/rx + offset             # <<<<<<<<<<<<<<
 *             x1 = (bpf._x1 - dx)/rx + offset
 *             if x0 < x1:
 */
  /*else*/ {
    __pyx_t_4 = (__pyx_v_bpf->_x0 - __pyx_v_dx);
    if (unlikely(__pyx_v_rx == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 4795, __pyx_L1_error)
    }
    __pyx_v_x0 = ((__pyx_t_4 / __pyx_v_rx) + __pyx_v_offset);

    /* "bpf4/core.pyx":4796
 *         else:
 *             x0 = (bpf._x0 - dx)/rx + offset
 *             x1 = (bpf._x1 - dx)/rx + offset             # <<<<<<<<<<<<<<
 *             if x0 < x1:
 *                 self._set_bounds(x0, x1)
 */
    __pyx_t_4 = (__pyx_v_bpf->_x1 - __pyx_v_dx);
    if (unlikely(__pyx_v_rx == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 4796, __pyx_L1_error)
    }
    __pyx_v_x1 = ((__pyx_t_4 / __pyx_v_rx) + __pyx_v_offset);

    /* "bpf4/core.pyx":4797
 *             x0 = (bpf._x0 - dx)/rx + offset
 *             x1 = (bpf._x1 - dx)/rx + offset
 *             if x0 < x1:             # <<<<<<<<<<<<<<
 *                 self._set_bounds(x0, x1)
 *             else:
 */
    __pyx_t_1 = ((__pyx_v_x0 < __pyx_v_x1) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":4798
 *             x1 = (bpf._x1 - dx)/rx + offset
 *             if x0 < x1:
 *                 self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 *             else:
 *                 self._set_bounds(x1, x0)
 */
      __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

      /* "bpf4/core.pyx":4797
 *             x0 = (bpf._x0 - dx)/rx + offset
 *             x1 = (bpf._x1 - dx)/rx + offset
 *             if x0 < x1:             # <<<<<<<<<<<<<<
 *                 self._set_bounds(x0, x1)
 *             else:
 */
      goto __pyx_L4;
    }

    /* "bpf4/core.pyx":4800
 *                 self._set_bounds(x0, x1)
 *             else:
 *                 self._set_bounds(x1, x0)             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
    /*else*/ {
      __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x1, __pyx_v_x0);
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "bpf4/core.pyx":4777
 *     cdef readonly double dx, rx, offset
 * 
 *     def __init__(self, BpfInterface bpf, double rx, double dx=0, double offset=0, bounds=None):             # <<<<<<<<<<<<<<
 *         """
 *         equation:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core._BpfProjection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4803
 * 
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         x = (x - self.offset) * self.rx + self.dx
 *         return self.bpf.__ccall__(x)
 */

static double __pyx_f_4bpf4_4core_14_BpfProjection___ccall__(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self, double __pyx_v_x) {
  double __pyx_r;

  /* "bpf4/core.pyx":4804
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:
 *         x = (x - self.offset) * self.rx + self.dx             # <<<<<<<<<<<<<<
 *         return self.bpf.__ccall__(x)
 * 
 */
  __pyx_v_x = (((__pyx_v_x - __pyx_v_self->offset) * __pyx_v_self->rx) + __pyx_v_self->dx);

  /* "bpf4/core.pyx":4805
 *     cdef double __ccall__(self, double x) nogil:
 *         x = (x - self.offset) * self.rx + self.dx
 *         return self.bpf.__ccall__(x)             # <<<<<<<<<<<<<<
 * 
 *     def fixpoint(self):
 */
  __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4803
 * 
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         x = (x - self.offset) * self.rx + self.dx
 *         return self.bpf.__ccall__(x)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4807
 *         return self.bpf.__ccall__(x)
 * 
 *     def fixpoint(self):             # <<<<<<<<<<<<<<
 *         return 1 - (self.fx - self.offset*self.rx)/self.rx
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfProjection_3fixpoint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_14_BpfProjection_2fixpoint[] = "_BpfProjection.fixpoint(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_14_BpfProjection_3fixpoint = {"fixpoint", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfProjection_3fixpoint, METH_NOARGS, __pyx_doc_4bpf4_4core_14_BpfProjection_2fixpoint};
static PyObject *__pyx_pw_4bpf4_4core_14_BpfProjection_3fixpoint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fixpoint (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfProjection_2fixpoint(((struct __pyx_obj_4bpf4_4core__BpfProjection *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfProjection_2fixpoint(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fixpoint", 0);

  /* "bpf4/core.pyx":4808
 * 
 *     def fixpoint(self):
 *         return 1 - (self.fx - self.offset*self.rx)/self.rx             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self): return (self.bpf, self.rx, self.dx, self.bounds())
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->offset * __pyx_v_self->rx)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4808, __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;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->rx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4807
 *         return self.bpf.__ccall__(x)
 * 
 *     def fixpoint(self):             # <<<<<<<<<<<<<<
 *         return 1 - (self.fx - self.offset*self.rx)/self.rx
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfProjection.fixpoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4810
 *         return 1 - (self.fx - self.offset*self.rx)/self.rx
 * 
 *     def __getstate__(self): return (self.bpf, self.rx, self.dx, self.bounds())             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfProjection_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_14_BpfProjection_4__getstate__[] = "_BpfProjection.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_14_BpfProjection_5__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfProjection_5__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_14_BpfProjection_4__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_14_BpfProjection_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfProjection_4__getstate__(((struct __pyx_obj_4bpf4_4core__BpfProjection *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfProjection_4__getstate__(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->rx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bounds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->bpf));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core._BpfProjection.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4775
 *     cdef BpfInterface bpf
 *     cdef double bpf_x0
 *     cdef readonly double dx, rx, offset             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, BpfInterface bpf, double rx, double dx=0, double offset=0, bounds=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfProjection_2dx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_14_BpfProjection_2dx_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfProjection_2dx___get__(((struct __pyx_obj_4bpf4_4core__BpfProjection *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfProjection_2dx___get__(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfProjection.dx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfProjection_2rx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_14_BpfProjection_2rx_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfProjection_2rx___get__(((struct __pyx_obj_4bpf4_4core__BpfProjection *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfProjection_2rx___get__(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->rx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfProjection.rx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_14_BpfProjection_6offset_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_14_BpfProjection_6offset_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_14_BpfProjection_6offset___get__(((struct __pyx_obj_4bpf4_4core__BpfProjection *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14_BpfProjection_6offset___get__(struct __pyx_obj_4bpf4_4core__BpfProjection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfProjection.offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4813
 * 
 * 
 * cdef double m_log(double x) nogil:             # <<<<<<<<<<<<<<
 *     # taken from python implementation (in C)
 *     if isfinite(x):  # INFNEG > x < INF:
 */

static double __pyx_f_4bpf4_4core_m_log(double __pyx_v_x) {
  double __pyx_r;
  int __pyx_t_1;

  /* "bpf4/core.pyx":4815
 * cdef double m_log(double x) nogil:
 *     # taken from python implementation (in C)
 *     if isfinite(x):  # INFNEG > x < INF:             # <<<<<<<<<<<<<<
 *         if x > 0:
 *             return log(x)
 */
  __pyx_t_1 = (isfinite(__pyx_v_x) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":4816
 *     # taken from python implementation (in C)
 *     if isfinite(x):  # INFNEG > x < INF:
 *         if x > 0:             # <<<<<<<<<<<<<<
 *             return log(x)
 *         if x == 0:
 */
    __pyx_t_1 = ((__pyx_v_x > 0.0) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":4817
 *     if isfinite(x):  # INFNEG > x < INF:
 *         if x > 0:
 *             return log(x)             # <<<<<<<<<<<<<<
 *         if x == 0:
 *             return INFNEG
 */
      __pyx_r = log(__pyx_v_x);
      goto __pyx_L0;

      /* "bpf4/core.pyx":4816
 *     # taken from python implementation (in C)
 *     if isfinite(x):  # INFNEG > x < INF:
 *         if x > 0:             # <<<<<<<<<<<<<<
 *             return log(x)
 *         if x == 0:
 */
    }

    /* "bpf4/core.pyx":4818
 *         if x > 0:
 *             return log(x)
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             return INFNEG
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_x == 0.0) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":4819
 *             return log(x)
 *         if x == 0:
 *             return INFNEG             # <<<<<<<<<<<<<<
 *         else:
 *             return NAN
 */
      __pyx_r = (-Py_HUGE_VAL);
      goto __pyx_L0;

      /* "bpf4/core.pyx":4818
 *         if x > 0:
 *             return log(x)
 *         if x == 0:             # <<<<<<<<<<<<<<
 *             return INFNEG
 *         else:
 */
    }

    /* "bpf4/core.pyx":4821
 *             return INFNEG
 *         else:
 *             return NAN             # <<<<<<<<<<<<<<
 *     elif isnan(x):
 *         return x
 */
    /*else*/ {
      __pyx_r = NAN;
      goto __pyx_L0;
    }

    /* "bpf4/core.pyx":4815
 * cdef double m_log(double x) nogil:
 *     # taken from python implementation (in C)
 *     if isfinite(x):  # INFNEG > x < INF:             # <<<<<<<<<<<<<<
 *         if x > 0:
 *             return log(x)
 */
  }

  /* "bpf4/core.pyx":4822
 *         else:
 *             return NAN
 *     elif isnan(x):             # <<<<<<<<<<<<<<
 *         return x
 *     elif x > 0:
 */
  __pyx_t_1 = (isnan(__pyx_v_x) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":4823
 *             return NAN
 *     elif isnan(x):
 *         return x             # <<<<<<<<<<<<<<
 *     elif x > 0:
 *         return x
 */
    __pyx_r = __pyx_v_x;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4822
 *         else:
 *             return NAN
 *     elif isnan(x):             # <<<<<<<<<<<<<<
 *         return x
 *     elif x > 0:
 */
  }

  /* "bpf4/core.pyx":4824
 *     elif isnan(x):
 *         return x
 *     elif x > 0:             # <<<<<<<<<<<<<<
 *         return x
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_x > 0.0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":4825
 *         return x
 *     elif x > 0:
 *         return x             # <<<<<<<<<<<<<<
 *     else:
 *         return NAN
 */
    __pyx_r = __pyx_v_x;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4824
 *     elif isnan(x):
 *         return x
 *     elif x > 0:             # <<<<<<<<<<<<<<
 *         return x
 *     else:
 */
  }

  /* "bpf4/core.pyx":4827
 *         return x
 *     else:
 *         return NAN             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_r = NAN;
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":4813
 * 
 * 
 * cdef double m_log(double x) nogil:             # <<<<<<<<<<<<<<
 *     # taken from python implementation (in C)
 *     if isfinite(x):  # INFNEG > x < INF:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4834
 *     cdef double EPSILON
 * 
 *     def __init__(self, BpfInterface bpf, double EPSILON=DEFAULT_EPSILON):             # <<<<<<<<<<<<<<
 *         #BpfInterface.__init__(self, INFNEG, INF)
 *         self._set_bounds(INFNEG, INF)
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_13_BpfKeepSlope_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_13_BpfKeepSlope_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf = 0;
  double __pyx_v_EPSILON;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bpf,&__pyx_n_s_EPSILON,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_EPSILON);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 4834, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
    if (values[1]) {
      __pyx_v_EPSILON = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_EPSILON == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4834, __pyx_L3_error)
    } else {
      __pyx_v_EPSILON = ((double)0.0001);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4834, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfKeepSlope.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bpf), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "bpf", 0))) __PYX_ERR(0, 4834, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfKeepSlope___init__(((struct __pyx_obj_4bpf4_4core__BpfKeepSlope *)__pyx_v_self), __pyx_v_bpf, __pyx_v_EPSILON);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_13_BpfKeepSlope___init__(struct __pyx_obj_4bpf4_4core__BpfKeepSlope *__pyx_v_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, double __pyx_v_EPSILON) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":4836
 *     def __init__(self, BpfInterface bpf, double EPSILON=DEFAULT_EPSILON):
 *         #BpfInterface.__init__(self, INFNEG, INF)
 *         self._set_bounds(INFNEG, INF)             # <<<<<<<<<<<<<<
 *         self.bpf = bpf
 *         self.EPSILON = EPSILON
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), (-Py_HUGE_VAL), Py_HUGE_VAL);

  /* "bpf4/core.pyx":4837
 *         #BpfInterface.__init__(self, INFNEG, INF)
 *         self._set_bounds(INFNEG, INF)
 *         self.bpf = bpf             # <<<<<<<<<<<<<<
 *         self.EPSILON = EPSILON
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GOTREF(__pyx_v_self->bpf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->bpf));
  __pyx_v_self->bpf = __pyx_v_bpf;

  /* "bpf4/core.pyx":4838
 *         self._set_bounds(INFNEG, INF)
 *         self.bpf = bpf
 *         self.EPSILON = EPSILON             # <<<<<<<<<<<<<<
 * 
 *     @cython.cdivision(True)
 */
  __pyx_v_self->EPSILON = __pyx_v_EPSILON;

  /* "bpf4/core.pyx":4834
 *     cdef double EPSILON
 * 
 *     def __init__(self, BpfInterface bpf, double EPSILON=DEFAULT_EPSILON):             # <<<<<<<<<<<<<<
 *         #BpfInterface.__init__(self, INFNEG, INF)
 *         self._set_bounds(INFNEG, INF)
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4841
 * 
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double slope
 *         cdef double x0 = self.bpf._x0
 */

static double __pyx_f_4bpf4_4core_13_BpfKeepSlope___ccall__(struct __pyx_obj_4bpf4_4core__BpfKeepSlope *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_slope;
  double __pyx_v_x0;
  double __pyx_v_x1;
  double __pyx_r;
  double __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "bpf4/core.pyx":4843
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double slope
 *         cdef double x0 = self.bpf._x0             # <<<<<<<<<<<<<<
 *         cdef double x1 = self.bpf._x1
 *         if x0 <= x <= x1:
 */
  __pyx_t_1 = __pyx_v_self->bpf->_x0;
  __pyx_v_x0 = __pyx_t_1;

  /* "bpf4/core.pyx":4844
 *         cdef double slope
 *         cdef double x0 = self.bpf._x0
 *         cdef double x1 = self.bpf._x1             # <<<<<<<<<<<<<<
 *         if x0 <= x <= x1:
 *             return self.bpf.__ccall__(x)
 */
  __pyx_t_1 = __pyx_v_self->bpf->_x1;
  __pyx_v_x1 = __pyx_t_1;

  /* "bpf4/core.pyx":4845
 *         cdef double x0 = self.bpf._x0
 *         cdef double x1 = self.bpf._x1
 *         if x0 <= x <= x1:             # <<<<<<<<<<<<<<
 *             return self.bpf.__ccall__(x)
 *         elif x > x1:
 */
  __pyx_t_2 = (__pyx_v_x0 <= __pyx_v_x);
  if (__pyx_t_2) {
    __pyx_t_2 = (__pyx_v_x <= __pyx_v_x1);
  }
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bpf4/core.pyx":4846
 *         cdef double x1 = self.bpf._x1
 *         if x0 <= x <= x1:
 *             return self.bpf.__ccall__(x)             # <<<<<<<<<<<<<<
 *         elif x > x1:
 *             slope = (self.bpf.__ccall__(x1) - self.bpf.__ccall__(x1 - self.EPSILON)) / self.EPSILON
 */
    __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x);
    goto __pyx_L0;

    /* "bpf4/core.pyx":4845
 *         cdef double x0 = self.bpf._x0
 *         cdef double x1 = self.bpf._x1
 *         if x0 <= x <= x1:             # <<<<<<<<<<<<<<
 *             return self.bpf.__ccall__(x)
 *         elif x > x1:
 */
  }

  /* "bpf4/core.pyx":4847
 *         if x0 <= x <= x1:
 *             return self.bpf.__ccall__(x)
 *         elif x > x1:             # <<<<<<<<<<<<<<
 *             slope = (self.bpf.__ccall__(x1) - self.bpf.__ccall__(x1 - self.EPSILON)) / self.EPSILON
 *             return self.bpf.__ccall__(x1) + slope * (x - x1)
 */
  __pyx_t_3 = ((__pyx_v_x > __pyx_v_x1) != 0);
  if (__pyx_t_3) {

    /* "bpf4/core.pyx":4848
 *             return self.bpf.__ccall__(x)
 *         elif x > x1:
 *             slope = (self.bpf.__ccall__(x1) - self.bpf.__ccall__(x1 - self.EPSILON)) / self.EPSILON             # <<<<<<<<<<<<<<
 *             return self.bpf.__ccall__(x1) + slope * (x - x1)
 *         else:
 */
    __pyx_v_slope = ((((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x1) - ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, (__pyx_v_x1 - __pyx_v_self->EPSILON))) / __pyx_v_self->EPSILON);

    /* "bpf4/core.pyx":4849
 *         elif x > x1:
 *             slope = (self.bpf.__ccall__(x1) - self.bpf.__ccall__(x1 - self.EPSILON)) / self.EPSILON
 *             return self.bpf.__ccall__(x1) + slope * (x - x1)             # <<<<<<<<<<<<<<
 *         else:
 *             slope = (self.bpf.__ccall__(x0 + self.EPSILON) - self.bpf.__ccall__(x0)) / self.EPSILON
 */
    __pyx_r = (((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x1) + (__pyx_v_slope * (__pyx_v_x - __pyx_v_x1)));
    goto __pyx_L0;

    /* "bpf4/core.pyx":4847
 *         if x0 <= x <= x1:
 *             return self.bpf.__ccall__(x)
 *         elif x > x1:             # <<<<<<<<<<<<<<
 *             slope = (self.bpf.__ccall__(x1) - self.bpf.__ccall__(x1 - self.EPSILON)) / self.EPSILON
 *             return self.bpf.__ccall__(x1) + slope * (x - x1)
 */
  }

  /* "bpf4/core.pyx":4851
 *             return self.bpf.__ccall__(x1) + slope * (x - x1)
 *         else:
 *             slope = (self.bpf.__ccall__(x0 + self.EPSILON) - self.bpf.__ccall__(x0)) / self.EPSILON             # <<<<<<<<<<<<<<
 *             return self.bpf.__ccall__(x0) + slope * (x - x0)
 * 
 */
  /*else*/ {
    __pyx_v_slope = ((((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, (__pyx_v_x0 + __pyx_v_self->EPSILON)) - ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x0)) / __pyx_v_self->EPSILON);

    /* "bpf4/core.pyx":4852
 *         else:
 *             slope = (self.bpf.__ccall__(x0 + self.EPSILON) - self.bpf.__ccall__(x0)) / self.EPSILON
 *             return self.bpf.__ccall__(x0) + slope * (x - x0)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self): return self.bpf, self.EPSILON
 */
    __pyx_r = (((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x0) + (__pyx_v_slope * (__pyx_v_x - __pyx_v_x0)));
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":4841
 * 
 *     @cython.cdivision(True)
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double slope
 *         cdef double x0 = self.bpf._x0
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4854
 *             return self.bpf.__ccall__(x0) + slope * (x - x0)
 * 
 *     def __getstate__(self): return self.bpf, self.EPSILON             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_BpfKeepSlope_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_13_BpfKeepSlope_2__getstate__[] = "_BpfKeepSlope.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_13_BpfKeepSlope_3__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_13_BpfKeepSlope_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_13_BpfKeepSlope_2__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_13_BpfKeepSlope_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_13_BpfKeepSlope_2__getstate__(((struct __pyx_obj_4bpf4_4core__BpfKeepSlope *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_BpfKeepSlope_2__getstate__(struct __pyx_obj_4bpf4_4core__BpfKeepSlope *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->EPSILON); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->bpf));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bpf4.core._BpfKeepSlope.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4862
 *     cdef readonly int outbound_mode
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         if self.outbound_mode == 0:
 *             return self.bpf.__ccall__(x)
 */

static double __pyx_f_4bpf4_4core_8_BpfCrop___ccall__(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, double __pyx_v_x) {
  double __pyx_r;
  int __pyx_t_1;

  /* "bpf4/core.pyx":4863
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         if self.outbound_mode == 0:             # <<<<<<<<<<<<<<
 *             return self.bpf.__ccall__(x)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->outbound_mode == 0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":4864
 *     cdef double __ccall__(self, double x) nogil:
 *         if self.outbound_mode == 0:
 *             return self.bpf.__ccall__(x)             # <<<<<<<<<<<<<<
 *         else:
 *             if x < self._x0:
 */
    __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x);
    goto __pyx_L0;

    /* "bpf4/core.pyx":4863
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         if self.outbound_mode == 0:             # <<<<<<<<<<<<<<
 *             return self.bpf.__ccall__(x)
 *         else:
 */
  }

  /* "bpf4/core.pyx":4866
 *             return self.bpf.__ccall__(x)
 *         else:
 *             if x < self._x0:             # <<<<<<<<<<<<<<
 *                 return self._y0
 *             elif x > self._x1:
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_x < __pyx_v_self->__pyx_base._x0) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":4867
 *         else:
 *             if x < self._x0:
 *                 return self._y0             # <<<<<<<<<<<<<<
 *             elif x > self._x1:
 *                 return self._y1
 */
      __pyx_r = __pyx_v_self->_y0;
      goto __pyx_L0;

      /* "bpf4/core.pyx":4866
 *             return self.bpf.__ccall__(x)
 *         else:
 *             if x < self._x0:             # <<<<<<<<<<<<<<
 *                 return self._y0
 *             elif x > self._x1:
 */
    }

    /* "bpf4/core.pyx":4868
 *             if x < self._x0:
 *                 return self._y0
 *             elif x > self._x1:             # <<<<<<<<<<<<<<
 *                 return self._y1
 *             return self.bpf.__ccall__(x)
 */
    __pyx_t_1 = ((__pyx_v_x > __pyx_v_self->__pyx_base._x1) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":4869
 *                 return self._y0
 *             elif x > self._x1:
 *                 return self._y1             # <<<<<<<<<<<<<<
 *             return self.bpf.__ccall__(x)
 * 
 */
      __pyx_r = __pyx_v_self->_y1;
      goto __pyx_L0;

      /* "bpf4/core.pyx":4868
 *             if x < self._x0:
 *                 return self._y0
 *             elif x > self._x1:             # <<<<<<<<<<<<<<
 *                 return self._y1
 *             return self.bpf.__ccall__(x)
 */
    }

    /* "bpf4/core.pyx":4870
 *             elif x > self._x1:
 *                 return self._y1
 *             return self.bpf.__ccall__(x)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
    __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x);
    goto __pyx_L0;
  }

  /* "bpf4/core.pyx":4862
 *     cdef readonly int outbound_mode
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         if self.outbound_mode == 0:
 *             return self.bpf.__ccall__(x)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":4872
 *             return self.bpf.__ccall__(x)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), (), (self.bpf, self._x0, self._x1, self.outbound_mode, self._y0, self._y1)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_8_BpfCrop___reduce__[] = "_BpfCrop.__reduce__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_8_BpfCrop_1__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_4bpf4_4core_8_BpfCrop_1__reduce__, METH_NOARGS, __pyx_doc_4bpf4_4core_8_BpfCrop___reduce__};
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_1__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_8_BpfCrop___reduce__(((struct __pyx_obj_4bpf4_4core__BpfCrop *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop___reduce__(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "bpf4/core.pyx":4873
 * 
 *     def __reduce__(self):
 *         return type(self), (), (self.bpf, self._x0, self._x1, self.outbound_mode, self._y0, self._y1)             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._x0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->outbound_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->_y0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->_y1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->bpf));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self->bpf));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_5);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __Pyx_INCREF(__pyx_empty_tuple);
  __Pyx_GIVEREF(__pyx_empty_tuple);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_empty_tuple);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4872
 *             return self.bpf.__ccall__(x)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), (), (self.bpf, self._x0, self._x1, self.outbound_mode, self._y0, self._y1)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core._BpfCrop.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4875
 *         return type(self), (), (self.bpf, self._x0, self._x1, self.outbound_mode, self._y0, self._y1)
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.bpf, x0, x1, self.outbound_mode, self._y0, self._y1 = state
 *         self._set_bounds(x0, x1)
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_3__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_4bpf4_4core_8_BpfCrop_2__setstate__[] = "_BpfCrop.__setstate__(self, state)";
static PyMethodDef __pyx_mdef_4bpf4_4core_8_BpfCrop_3__setstate__ = {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_8_BpfCrop_3__setstate__, METH_O, __pyx_doc_4bpf4_4core_8_BpfCrop_2__setstate__};
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_3__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_8_BpfCrop_2__setstate__(((struct __pyx_obj_4bpf4_4core__BpfCrop *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_2__setstate__(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_v_x0 = NULL;
  PyObject *__pyx_v_x1 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  double __pyx_t_10;
  double __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "bpf4/core.pyx":4876
 * 
 *     def __setstate__(self, state):
 *         self.bpf, x0, x1, self.outbound_mode, self._y0, self._y1 = state             # <<<<<<<<<<<<<<
 *         self._set_bounds(x0, x1)
 * 
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_state))) || (PyList_CheckExact(__pyx_v_state))) {
    PyObject* sequence = __pyx_v_state;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 6)) {
      if (size > 6) __Pyx_RaiseTooManyValuesError(6);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 4876, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 5); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 5); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[6] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6};
      for (i=0; i < 6; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 4876, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[6] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6};
    __pyx_t_7 = PyObject_GetIter(__pyx_v_state); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
    for (index=0; index < 6; index++) {
      PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 6) < 0) __PYX_ERR(0, 4876, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 4876, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 4876, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4876, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4876, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4876, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->bpf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->bpf));
  __pyx_v_self->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_x0 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_x1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_self->outbound_mode = __pyx_t_9;
  __pyx_v_self->_y0 = __pyx_t_10;
  __pyx_v_self->_y1 = __pyx_t_11;

  /* "bpf4/core.pyx":4877
 *     def __setstate__(self, state):
 *         self.bpf, x0, x1, self.outbound_mode, self._y0, self._y1 = state
 *         self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _BpfCrop outbound_set(self, double y0, double y1):
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_x0); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4877, __pyx_L1_error)
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_x1); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4877, __pyx_L1_error)
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_t_11, __pyx_t_10);

  /* "bpf4/core.pyx":4875
 *         return type(self), (), (self.bpf, self._x0, self._x1, self.outbound_mode, self._y0, self._y1)
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.bpf, x0, x1, self.outbound_mode, self._y0, self._y1 = state
 *         self._set_bounds(x0, x1)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bpf4.core._BpfCrop.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x0);
  __Pyx_XDECREF(__pyx_v_x1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4879
 *         self._set_bounds(x0, x1)
 * 
 *     cpdef _BpfCrop outbound_set(self, double y0, double y1):             # <<<<<<<<<<<<<<
 *         """
 *         set the value returned by this BPF outside its defined bounds (inplace)
 */

static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_5outbound_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_f_4bpf4_4core_8_BpfCrop_outbound_set(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, double __pyx_v_y0, double __pyx_v_y1, int __pyx_skip_dispatch) {
  struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("outbound_set", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_outbound_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_8_BpfCrop_5outbound_set)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4879, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_y1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4879, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4879, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4879, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4879, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (__pyx_t_6) {
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4879, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4bpf4_4core__BpfCrop))))) __PYX_ERR(0, 4879, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_4bpf4_4core__BpfCrop *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4883
 *         set the value returned by this BPF outside its defined bounds (inplace)
 *         """
 *         self.outbound_mode = OUTBOUND_SET             # <<<<<<<<<<<<<<
 *         self._y0 = y0
 *         self._y1 = y1
 */
  __pyx_v_self->outbound_mode = 2;

  /* "bpf4/core.pyx":4884
 *         """
 *         self.outbound_mode = OUTBOUND_SET
 *         self._y0 = y0             # <<<<<<<<<<<<<<
 *         self._y1 = y1
 *         return self
 */
  __pyx_v_self->_y0 = __pyx_v_y0;

  /* "bpf4/core.pyx":4885
 *         self.outbound_mode = OUTBOUND_SET
 *         self._y0 = y0
 *         self._y1 = y1             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_v_self->_y1 = __pyx_v_y1;

  /* "bpf4/core.pyx":4886
 *         self._y0 = y0
 *         self._y1 = y1
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def outbound(self, double y0, y1=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4879
 *         self._set_bounds(x0, x1)
 * 
 *     cpdef _BpfCrop outbound_set(self, double y0, double y1):             # <<<<<<<<<<<<<<
 *         """
 *         set the value returned by this BPF outside its defined bounds (inplace)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bpf4.core._BpfCrop.outbound_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_5outbound_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_8_BpfCrop_4outbound_set[] = "_BpfCrop.outbound_set(self, double y0, double y1) -> _BpfCrop\n\n        set the value returned by this BPF outside its defined bounds (inplace)\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_8_BpfCrop_5outbound_set = {"outbound_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_8_BpfCrop_5outbound_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_8_BpfCrop_4outbound_set};
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_5outbound_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_y0;
  double __pyx_v_y1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outbound_set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y0,&__pyx_n_s_y1,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("outbound_set", 1, 2, 2, 1); __PYX_ERR(0, 4879, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outbound_set") < 0)) __PYX_ERR(0, 4879, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_y0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_y0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4879, __pyx_L3_error)
    __pyx_v_y1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_y1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4879, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("outbound_set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4879, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfCrop.outbound_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_8_BpfCrop_4outbound_set(((struct __pyx_obj_4bpf4_4core__BpfCrop *)__pyx_v_self), __pyx_v_y0, __pyx_v_y1);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_4outbound_set(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, double __pyx_v_y0, double __pyx_v_y1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("outbound_set", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_8_BpfCrop_outbound_set(__pyx_v_self, __pyx_v_y0, __pyx_v_y1, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfCrop.outbound_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4888
 *         return self
 * 
 *     def outbound(self, double y0, y1=None):             # <<<<<<<<<<<<<<
 *         """
 *         return a new Bpf with the given values outside the bounds
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_7outbound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_8_BpfCrop_6outbound[] = "_BpfCrop.outbound(self, double y0, y1=None)\n\n        return a new Bpf with the given values outside the bounds\n\n        !!! note\n    \n            One can specify one value for lower and one for upper bounds, \n            or just one value for both\n        ";
static PyMethodDef __pyx_mdef_4bpf4_4core_8_BpfCrop_7outbound = {"outbound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_8_BpfCrop_7outbound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_8_BpfCrop_6outbound};
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_7outbound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_y0;
  PyObject *__pyx_v_y1 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outbound (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y0,&__pyx_n_s_y1,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outbound") < 0)) __PYX_ERR(0, 4888, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_y0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_y0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4888, __pyx_L3_error)
    __pyx_v_y1 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("outbound", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4888, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfCrop.outbound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_8_BpfCrop_6outbound(((struct __pyx_obj_4bpf4_4core__BpfCrop *)__pyx_v_self), __pyx_v_y0, __pyx_v_y1);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_6outbound(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, double __pyx_v_y0, PyObject *__pyx_v_y1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  double __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_4bpf4_4core__BpfCrop_new __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("outbound", 0);
  __Pyx_INCREF(__pyx_v_y1);

  /* "bpf4/core.pyx":4897
 *             or just one value for both
 *         """
 *         if y1 is None:             # <<<<<<<<<<<<<<
 *             y1 = y0
 *         return _BpfCrop_new(self.bpf, self._x0, self._x1, OUTBOUND_SET, y0, y1)
 */
  __pyx_t_1 = (__pyx_v_y1 == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":4898
 *         """
 *         if y1 is None:
 *             y1 = y0             # <<<<<<<<<<<<<<
 *         return _BpfCrop_new(self.bpf, self._x0, self._x1, OUTBOUND_SET, y0, y1)
 * 
 */
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_y1, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "bpf4/core.pyx":4897
 *             or just one value for both
 *         """
 *         if y1 is None:             # <<<<<<<<<<<<<<
 *             y1 = y0
 *         return _BpfCrop_new(self.bpf, self._x0, self._x1, OUTBOUND_SET, y0, y1)
 */
  }

  /* "bpf4/core.pyx":4899
 *         if y1 is None:
 *             y1 = y0
 *         return _BpfCrop_new(self.bpf, self._x0, self._x1, OUTBOUND_SET, y0, y1)             # <<<<<<<<<<<<<<
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_v_self->bpf);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_y1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4899, __pyx_L1_error)
  __pyx_t_6.__pyx_n = 2;
  __pyx_t_6.outbound0 = __pyx_v_y0;
  __pyx_t_6.outbound1 = __pyx_t_4;
  __pyx_t_5 = ((PyObject *)__pyx_f_4bpf4_4core__BpfCrop_new(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_3), __pyx_v_self->__pyx_base._x0, __pyx_v_self->__pyx_base._x1, 2, 0, &__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4888
 *         return self
 * 
 *     def outbound(self, double y0, y1=None):             # <<<<<<<<<<<<<<
 *         """
 *         return a new Bpf with the given values outside the bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core._BpfCrop.outbound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_y1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4901
 *         return _BpfCrop_new(self.bpf, self._x0, self._x1, OUTBOUND_SET, y0, y1)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         if x0 >= self.bpf._x0 and x1 <= self.bpf._x1:
 *             return self.bpf.integrate_between(x0, x1)
 */

static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_9integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static double __pyx_f_4bpf4_4core_8_BpfCrop_integrate_between(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_8_BpfCrop_integrate_between *__pyx_optional_args) {
  size_t __pyx_v_N = ((size_t)0);
  double __pyx_v_integr0;
  double __pyx_v_integr1;
  double __pyx_v_integr2;
  double __pyx_v__x0;
  double __pyx_v__x1;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_N = __pyx_optional_args->N;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_integrate_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_8_BpfCrop_9integrate_between)) {
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4901, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4901, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4901, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4901, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4901, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4902
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         if x0 >= self.bpf._x0 and x1 <= self.bpf._x1:             # <<<<<<<<<<<<<<
 *             return self.bpf.integrate_between(x0, x1)
 *         cdef double integr0=0., integr1=0., integr2=0., _x0, _x1
 */
  __pyx_t_12 = ((__pyx_v_x0 >= __pyx_v_self->bpf->_x0) != 0);
  if (__pyx_t_12) {
  } else {
    __pyx_t_11 = __pyx_t_12;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_12 = ((__pyx_v_x1 <= __pyx_v_self->bpf->_x1) != 0);
  __pyx_t_11 = __pyx_t_12;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":4903
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         if x0 >= self.bpf._x0 and x1 <= self.bpf._x1:
 *             return self.bpf.integrate_between(x0, x1)             # <<<<<<<<<<<<<<
 *         cdef double integr0=0., integr1=0., integr2=0., _x0, _x1
 *         if x0 < self.bpf._x0:
 */
    __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->integrate_between(__pyx_v_self->bpf, __pyx_v_x0, __pyx_v_x1, 0, NULL);
    goto __pyx_L0;

    /* "bpf4/core.pyx":4902
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):
 *         if x0 >= self.bpf._x0 and x1 <= self.bpf._x1:             # <<<<<<<<<<<<<<
 *             return self.bpf.integrate_between(x0, x1)
 *         cdef double integr0=0., integr1=0., integr2=0., _x0, _x1
 */
  }

  /* "bpf4/core.pyx":4904
 *         if x0 >= self.bpf._x0 and x1 <= self.bpf._x1:
 *             return self.bpf.integrate_between(x0, x1)
 *         cdef double integr0=0., integr1=0., integr2=0., _x0, _x1             # <<<<<<<<<<<<<<
 *         if x0 < self.bpf._x0:
 *             integr0 = self.__ccall__(x0) * (self.bpf._x0 - x0)
 */
  __pyx_v_integr0 = 0.;
  __pyx_v_integr1 = 0.;
  __pyx_v_integr2 = 0.;

  /* "bpf4/core.pyx":4905
 *             return self.bpf.integrate_between(x0, x1)
 *         cdef double integr0=0., integr1=0., integr2=0., _x0, _x1
 *         if x0 < self.bpf._x0:             # <<<<<<<<<<<<<<
 *             integr0 = self.__ccall__(x0) * (self.bpf._x0 - x0)
 *             _x0 = self.bpf._x0
 */
  __pyx_t_11 = ((__pyx_v_x0 < __pyx_v_self->bpf->_x0) != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":4906
 *         cdef double integr0=0., integr1=0., integr2=0., _x0, _x1
 *         if x0 < self.bpf._x0:
 *             integr0 = self.__ccall__(x0) * (self.bpf._x0 - x0)             # <<<<<<<<<<<<<<
 *             _x0 = self.bpf._x0
 *         else:
 */
    __pyx_v_integr0 = (((struct __pyx_vtabstruct_4bpf4_4core__BpfCrop *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___ccall__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0) * (__pyx_v_self->bpf->_x0 - __pyx_v_x0));

    /* "bpf4/core.pyx":4907
 *         if x0 < self.bpf._x0:
 *             integr0 = self.__ccall__(x0) * (self.bpf._x0 - x0)
 *             _x0 = self.bpf._x0             # <<<<<<<<<<<<<<
 *         else:
 *             _x0 = x0
 */
    __pyx_t_10 = __pyx_v_self->bpf->_x0;
    __pyx_v__x0 = __pyx_t_10;

    /* "bpf4/core.pyx":4905
 *             return self.bpf.integrate_between(x0, x1)
 *         cdef double integr0=0., integr1=0., integr2=0., _x0, _x1
 *         if x0 < self.bpf._x0:             # <<<<<<<<<<<<<<
 *             integr0 = self.__ccall__(x0) * (self.bpf._x0 - x0)
 *             _x0 = self.bpf._x0
 */
    goto __pyx_L6;
  }

  /* "bpf4/core.pyx":4909
 *             _x0 = self.bpf._x0
 *         else:
 *             _x0 = x0             # <<<<<<<<<<<<<<
 *         if self._x1 > self.bpf._x1:
 *             integr2 = self.__ccall__(x1) * (x1 - self.bpf._x1)
 */
  /*else*/ {
    __pyx_v__x0 = __pyx_v_x0;
  }
  __pyx_L6:;

  /* "bpf4/core.pyx":4910
 *         else:
 *             _x0 = x0
 *         if self._x1 > self.bpf._x1:             # <<<<<<<<<<<<<<
 *             integr2 = self.__ccall__(x1) * (x1 - self.bpf._x1)
 *             _x1 = self.bpf._x1
 */
  __pyx_t_11 = ((__pyx_v_self->__pyx_base._x1 > __pyx_v_self->bpf->_x1) != 0);
  if (__pyx_t_11) {

    /* "bpf4/core.pyx":4911
 *             _x0 = x0
 *         if self._x1 > self.bpf._x1:
 *             integr2 = self.__ccall__(x1) * (x1 - self.bpf._x1)             # <<<<<<<<<<<<<<
 *             _x1 = self.bpf._x1
 *         else:
 */
    __pyx_v_integr2 = (((struct __pyx_vtabstruct_4bpf4_4core__BpfCrop *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___ccall__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x1) * (__pyx_v_x1 - __pyx_v_self->bpf->_x1));

    /* "bpf4/core.pyx":4912
 *         if self._x1 > self.bpf._x1:
 *             integr2 = self.__ccall__(x1) * (x1 - self.bpf._x1)
 *             _x1 = self.bpf._x1             # <<<<<<<<<<<<<<
 *         else:
 *             _x1 = x1
 */
    __pyx_t_10 = __pyx_v_self->bpf->_x1;
    __pyx_v__x1 = __pyx_t_10;

    /* "bpf4/core.pyx":4910
 *         else:
 *             _x0 = x0
 *         if self._x1 > self.bpf._x1:             # <<<<<<<<<<<<<<
 *             integr2 = self.__ccall__(x1) * (x1 - self.bpf._x1)
 *             _x1 = self.bpf._x1
 */
    goto __pyx_L7;
  }

  /* "bpf4/core.pyx":4914
 *             _x1 = self.bpf._x1
 *         else:
 *             _x1 = x1             # <<<<<<<<<<<<<<
 *         integr1 = self.bpf.integrate_between(_x0, _x1)
 *         return integr0 + integr1 + integr2
 */
  /*else*/ {
    __pyx_v__x1 = __pyx_v_x1;
  }
  __pyx_L7:;

  /* "bpf4/core.pyx":4915
 *         else:
 *             _x1 = x1
 *         integr1 = self.bpf.integrate_between(_x0, _x1)             # <<<<<<<<<<<<<<
 *         return integr0 + integr1 + integr2
 * 
 */
  __pyx_v_integr1 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->integrate_between(__pyx_v_self->bpf, __pyx_v__x0, __pyx_v__x1, 0, NULL);

  /* "bpf4/core.pyx":4916
 *             _x1 = x1
 *         integr1 = self.bpf.integrate_between(_x0, _x1)
 *         return integr0 + integr1 + integr2             # <<<<<<<<<<<<<<
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 */
  __pyx_r = ((__pyx_v_integr0 + __pyx_v_integr1) + __pyx_v_integr2);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4901
 *         return _BpfCrop_new(self.bpf, self._x0, self._x1, OUTBOUND_SET, y0, y1)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         if x0 >= self.bpf._x0 and x1 <= self.bpf._x1:
 *             return self.bpf.integrate_between(x0, x1)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("bpf4.core._BpfCrop.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_9integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_8_BpfCrop_8integrate_between[] = "_BpfCrop.integrate_between(self, double x0, double x1, size_t N=0) -> double";
static PyMethodDef __pyx_mdef_4bpf4_4core_8_BpfCrop_9integrate_between = {"integrate_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_8_BpfCrop_9integrate_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_8_BpfCrop_8integrate_between};
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_9integrate_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  size_t __pyx_v_N;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_N,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, 1); __PYX_ERR(0, 4901, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrate_between") < 0)) __PYX_ERR(0, 4901, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4901, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4901, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_N == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 4901, __pyx_L3_error)
    } else {
      __pyx_v_N = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("integrate_between", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4901, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfCrop.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_8_BpfCrop_8integrate_between(((struct __pyx_obj_4bpf4_4core__BpfCrop *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, __pyx_v_N);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_8integrate_between(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, double __pyx_v_x0, double __pyx_v_x1, size_t __pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("integrate_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_1 = __pyx_vtabptr_4bpf4_4core__BpfCrop->__pyx_base.integrate_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2); 
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfCrop.integrate_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4918
 *         return integr0 + integr1 + integr2
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if self.outbound_mode == OUTBOUND_DONOTHING:
 *             return self.bpf.mapn_between(n, x0, x1, out)
 */

static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_11mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_4bpf4_4core_8_BpfCrop_mapn_between(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_8_BpfCrop_mapn_between *__pyx_optional_args) {
  PyArrayObject *__pyx_v_out = ((PyArrayObject *)Py_None);
  double __pyx_v_y1;
  double __pyx_v_intersect_x1;
  double __pyx_v_dx;
  int __pyx_v_i;
  int __pyx_v_intersect_n;
  PyArrayObject *__pyx_v_A = 0;
  PyArrayObject *__pyx_v_intersection = 0;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_data;
  int __pyx_v_j;
  double __pyx_v_intersect_x0_quant;
  double __pyx_v_diff;
  double __pyx_v_intersect_x1_quant;
  __pyx_t_4bpf4_4core_DTYPE_t *__pyx_v_intersection_data;
  CYTHON_UNUSED double __pyx_v_intersect_dx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
  __Pyx_Buffer __pyx_pybuffer_A;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_intersection;
  __Pyx_Buffer __pyx_pybuffer_intersection;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_11;
  double __pyx_t_12;
  long __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  double __pyx_t_16;
  double __pyx_t_17;
  int __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  Py_ssize_t __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_out = __pyx_optional_args->out;
    }
  }
  __pyx_pybuffer_A.pybuffer.buf = NULL;
  __pyx_pybuffer_A.refcount = 0;
  __pyx_pybuffernd_A.data = NULL;
  __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
  __pyx_pybuffer_intersection.pybuffer.buf = NULL;
  __pyx_pybuffer_intersection.refcount = 0;
  __pyx_pybuffernd_intersection.data = NULL;
  __pyx_pybuffernd_intersection.rcbuffer = &__pyx_pybuffer_intersection;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapn_between); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4918, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4bpf4_4core_8_BpfCrop_11mapn_between)) {
        __Pyx_XDECREF(((PyObject *)__pyx_r));
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4918, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4918, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4918, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4918, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_out)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4918, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4918, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_7) {
            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
          __Pyx_INCREF(((PyObject *)__pyx_v_out));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
          PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, ((PyObject *)__pyx_v_out));
          __pyx_t_3 = 0;
          __pyx_t_4 = 0;
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4918, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4918, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "bpf4/core.pyx":4919
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         if self.outbound_mode == OUTBOUND_DONOTHING:             # <<<<<<<<<<<<<<
 *             return self.bpf.mapn_between(n, x0, x1, out)
 *         if x0 >= self._x1:
 */
  __pyx_t_10 = ((__pyx_v_self->outbound_mode == 0) != 0);
  if (__pyx_t_10) {

    /* "bpf4/core.pyx":4920
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         if self.outbound_mode == OUTBOUND_DONOTHING:
 *             return self.bpf.mapn_between(n, x0, x1, out)             # <<<<<<<<<<<<<<
 *         if x0 >= self._x1:
 *             return numpy.ones((n,), dtype=float) * self.__ccall__(x0)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.out = __pyx_v_out;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->mapn_between(__pyx_v_self->bpf, __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 0, &__pyx_t_11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4919
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):
 *         if self.outbound_mode == OUTBOUND_DONOTHING:             # <<<<<<<<<<<<<<
 *             return self.bpf.mapn_between(n, x0, x1, out)
 *         if x0 >= self._x1:
 */
  }

  /* "bpf4/core.pyx":4921
 *         if self.outbound_mode == OUTBOUND_DONOTHING:
 *             return self.bpf.mapn_between(n, x0, x1, out)
 *         if x0 >= self._x1:             # <<<<<<<<<<<<<<
 *             return numpy.ones((n,), dtype=float) * self.__ccall__(x0)
 *         if x1 <= self._x0:
 */
  __pyx_t_10 = ((__pyx_v_x0 >= __pyx_v_self->__pyx_base._x1) != 0);
  if (__pyx_t_10) {

    /* "bpf4/core.pyx":4922
 *             return self.bpf.mapn_between(n, x0, x1, out)
 *         if x0 >= self._x1:
 *             return numpy.ones((n,), dtype=float) * self.__ccall__(x0)             # <<<<<<<<<<<<<<
 *         if x1 <= self._x0:
 *             return numpy.ones((n,), dtype=float) * self.__ccall__(x1)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 4922, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4bpf4_4core__BpfCrop *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___ccall__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4922, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4921
 *         if self.outbound_mode == OUTBOUND_DONOTHING:
 *             return self.bpf.mapn_between(n, x0, x1, out)
 *         if x0 >= self._x1:             # <<<<<<<<<<<<<<
 *             return numpy.ones((n,), dtype=float) * self.__ccall__(x0)
 *         if x1 <= self._x0:
 */
  }

  /* "bpf4/core.pyx":4923
 *         if x0 >= self._x1:
 *             return numpy.ones((n,), dtype=float) * self.__ccall__(x0)
 *         if x1 <= self._x0:             # <<<<<<<<<<<<<<
 *             return numpy.ones((n,), dtype=float) * self.__ccall__(x1)
 * 
 */
  __pyx_t_10 = ((__pyx_v_x1 <= __pyx_v_self->__pyx_base._x0) != 0);
  if (__pyx_t_10) {

    /* "bpf4/core.pyx":4924
 *             return numpy.ones((n,), dtype=float) * self.__ccall__(x0)
 *         if x1 <= self._x0:
 *             return numpy.ones((n,), dtype=float) * self.__ccall__(x1)             # <<<<<<<<<<<<<<
 * 
 *         cdef double x, y0, y1, intersect_x0, intersect_x1, dx
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 4924, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4bpf4_4core__BpfCrop *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___ccall__(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4924, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":4923
 *         if x0 >= self._x1:
 *             return numpy.ones((n,), dtype=float) * self.__ccall__(x0)
 *         if x1 <= self._x0:             # <<<<<<<<<<<<<<
 *             return numpy.ones((n,), dtype=float) * self.__ccall__(x1)
 * 
 */
  }

  /* "bpf4/core.pyx":4927
 * 
 *         cdef double x, y0, y1, intersect_x0, intersect_x1, dx
 *         cdef int i = 0             # <<<<<<<<<<<<<<
 *         cdef int intersect_n, intersect_i0, intersect_i
 * 
 */
  __pyx_v_i = 0;

  /* "bpf4/core.pyx":4930
 *         cdef int intersect_n, intersect_i0, intersect_i
 * 
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = out if out is not None else EMPTY1D(n)             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] intersection
 * 
 */
  __pyx_t_10 = (((PyObject *)__pyx_v_out) != Py_None);
  if ((__pyx_t_10 != 0)) {
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_t_1 = ((PyObject *)__pyx_v_out);
  } else {
    __pyx_t_9 = ((PyObject *)__pyx_f_4bpf4_4core_EMPTY1D(__pyx_v_n)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __pyx_t_9;
    __pyx_t_9 = 0;
  }
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_A = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_A.rcbuffer->pybuffer.buf = NULL;
      __PYX_ERR(0, 4930, __pyx_L1_error)
    } else {__pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_v_A = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4933
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] intersection
 * 
 *         cdef DTYPE_t *data = <DTYPE_t*>(A.data)             # <<<<<<<<<<<<<<
 * 
 *         dx = (x1 - x0) / (n - 1)
 */
  __pyx_v_data = ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_A->data);

  /* "bpf4/core.pyx":4935
 *         cdef DTYPE_t *data = <DTYPE_t*>(A.data)
 * 
 *         dx = (x1 - x0) / (n - 1)             # <<<<<<<<<<<<<<
 * 
 *         if x0 < self._x0:
 */
  __pyx_t_12 = (__pyx_v_x1 - __pyx_v_x0);
  __pyx_t_13 = (__pyx_v_n - 1);
  if (unlikely(__pyx_t_13 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 4935, __pyx_L1_error)
  }
  __pyx_v_dx = (__pyx_t_12 / ((double)__pyx_t_13));

  /* "bpf4/core.pyx":4937
 *         dx = (x1 - x0) / (n - 1)
 * 
 *         if x0 < self._x0:             # <<<<<<<<<<<<<<
 *             i = <int>((self._x0 - x0) / dx)
 *             for j in range(i):
 */
  __pyx_t_10 = ((__pyx_v_x0 < __pyx_v_self->__pyx_base._x0) != 0);
  if (__pyx_t_10) {

    /* "bpf4/core.pyx":4938
 * 
 *         if x0 < self._x0:
 *             i = <int>((self._x0 - x0) / dx)             # <<<<<<<<<<<<<<
 *             for j in range(i):
 *                 data[j] = self._y0
 */
    __pyx_t_12 = (__pyx_v_self->__pyx_base._x0 - __pyx_v_x0);
    if (unlikely(__pyx_v_dx == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 4938, __pyx_L1_error)
    }
    __pyx_v_i = ((int)(__pyx_t_12 / __pyx_v_dx));

    /* "bpf4/core.pyx":4939
 *         if x0 < self._x0:
 *             i = <int>((self._x0 - x0) / dx)
 *             for j in range(i):             # <<<<<<<<<<<<<<
 *                 data[j] = self._y0
 *             intersect_x0_quant = x0 + dx*i
 */
    __pyx_t_8 = __pyx_v_i;
    __pyx_t_14 = __pyx_t_8;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "bpf4/core.pyx":4940
 *             i = <int>((self._x0 - x0) / dx)
 *             for j in range(i):
 *                 data[j] = self._y0             # <<<<<<<<<<<<<<
 *             intersect_x0_quant = x0 + dx*i
 *         else:
 */
      __pyx_t_12 = __pyx_v_self->_y0;
      (__pyx_v_data[__pyx_v_j]) = __pyx_t_12;
    }

    /* "bpf4/core.pyx":4941
 *             for j in range(i):
 *                 data[j] = self._y0
 *             intersect_x0_quant = x0 + dx*i             # <<<<<<<<<<<<<<
 *         else:
 *             intersect_x0_quant = x0
 */
    __pyx_v_intersect_x0_quant = (__pyx_v_x0 + (__pyx_v_dx * __pyx_v_i));

    /* "bpf4/core.pyx":4937
 *         dx = (x1 - x0) / (n - 1)
 * 
 *         if x0 < self._x0:             # <<<<<<<<<<<<<<
 *             i = <int>((self._x0 - x0) / dx)
 *             for j in range(i):
 */
    goto __pyx_L6;
  }

  /* "bpf4/core.pyx":4943
 *             intersect_x0_quant = x0 + dx*i
 *         else:
 *             intersect_x0_quant = x0             # <<<<<<<<<<<<<<
 * 
 *         intersect_x1 = min(x1, self._x1)
 */
  /*else*/ {
    __pyx_v_intersect_x0_quant = __pyx_v_x0;
  }
  __pyx_L6:;

  /* "bpf4/core.pyx":4945
 *             intersect_x0_quant = x0
 * 
 *         intersect_x1 = min(x1, self._x1)             # <<<<<<<<<<<<<<
 *         cdef double diff = ((intersect_x1 - x0) % dx)
 *         if diff < 1e-15 or (dx - diff) < 1e-15:
 */
  __pyx_t_12 = __pyx_v_self->__pyx_base._x1;
  __pyx_t_16 = __pyx_v_x1;
  if (((__pyx_t_12 < __pyx_t_16) != 0)) {
    __pyx_t_17 = __pyx_t_12;
  } else {
    __pyx_t_17 = __pyx_t_16;
  }
  __pyx_v_intersect_x1 = __pyx_t_17;

  /* "bpf4/core.pyx":4946
 * 
 *         intersect_x1 = min(x1, self._x1)
 *         cdef double diff = ((intersect_x1 - x0) % dx)             # <<<<<<<<<<<<<<
 *         if diff < 1e-15 or (dx - diff) < 1e-15:
 *             diff = 0
 */
  __pyx_t_17 = (__pyx_v_intersect_x1 - __pyx_v_x0);
  if (unlikely(__pyx_v_dx == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float divmod()");
    __PYX_ERR(0, 4946, __pyx_L1_error)
  }
  __pyx_v_diff = __Pyx_mod_double(__pyx_t_17, __pyx_v_dx);

  /* "bpf4/core.pyx":4947
 *         intersect_x1 = min(x1, self._x1)
 *         cdef double diff = ((intersect_x1 - x0) % dx)
 *         if diff < 1e-15 or (dx - diff) < 1e-15:             # <<<<<<<<<<<<<<
 *             diff = 0
 *         intersect_x1_quant = intersect_x1 - diff
 */
  __pyx_t_18 = ((__pyx_v_diff < 1e-15) != 0);
  if (!__pyx_t_18) {
  } else {
    __pyx_t_10 = __pyx_t_18;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_18 = (((__pyx_v_dx - __pyx_v_diff) < 1e-15) != 0);
  __pyx_t_10 = __pyx_t_18;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_10) {

    /* "bpf4/core.pyx":4948
 *         cdef double diff = ((intersect_x1 - x0) % dx)
 *         if diff < 1e-15 or (dx - diff) < 1e-15:
 *             diff = 0             # <<<<<<<<<<<<<<
 *         intersect_x1_quant = intersect_x1 - diff
 *         intersect_n = _dxton(dx, intersect_x0_quant, intersect_x1_quant)
 */
    __pyx_v_diff = 0.0;

    /* "bpf4/core.pyx":4947
 *         intersect_x1 = min(x1, self._x1)
 *         cdef double diff = ((intersect_x1 - x0) % dx)
 *         if diff < 1e-15 or (dx - diff) < 1e-15:             # <<<<<<<<<<<<<<
 *             diff = 0
 *         intersect_x1_quant = intersect_x1 - diff
 */
  }

  /* "bpf4/core.pyx":4949
 *         if diff < 1e-15 or (dx - diff) < 1e-15:
 *             diff = 0
 *         intersect_x1_quant = intersect_x1 - diff             # <<<<<<<<<<<<<<
 *         intersect_n = _dxton(dx, intersect_x0_quant, intersect_x1_quant)
 *         intersection = self.bpf.mapn_between(intersect_n, intersect_x0_quant, intersect_x1_quant)
 */
  __pyx_v_intersect_x1_quant = (__pyx_v_intersect_x1 - __pyx_v_diff);

  /* "bpf4/core.pyx":4950
 *             diff = 0
 *         intersect_x1_quant = intersect_x1 - diff
 *         intersect_n = _dxton(dx, intersect_x0_quant, intersect_x1_quant)             # <<<<<<<<<<<<<<
 *         intersection = self.bpf.mapn_between(intersect_n, intersect_x0_quant, intersect_x1_quant)
 *         cdef DTYPE_t *intersection_data = <DTYPE_t*>(intersection.data)
 */
  __pyx_v_intersect_n = __pyx_f_4bpf4_4core__dxton(__pyx_v_dx, __pyx_v_intersect_x0_quant, __pyx_v_intersect_x1_quant);

  /* "bpf4/core.pyx":4951
 *         intersect_x1_quant = intersect_x1 - diff
 *         intersect_n = _dxton(dx, intersect_x0_quant, intersect_x1_quant)
 *         intersection = self.bpf.mapn_between(intersect_n, intersect_x0_quant, intersect_x1_quant)             # <<<<<<<<<<<<<<
 *         cdef DTYPE_t *intersection_data = <DTYPE_t*>(intersection.data)
 *         cdef double intersect_dx = _ntodx(intersect_n, intersect_x0_quant, intersect_x1_quant)
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->mapn_between(__pyx_v_self->bpf, __pyx_v_intersect_n, __pyx_v_intersect_x0_quant, __pyx_v_intersect_x1_quant, 0, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intersection.rcbuffer->pybuffer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_intersection.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_intersection.rcbuffer->pybuffer, (PyObject*)__pyx_v_intersection, &__Pyx_TypeInfo_nn___pyx_t_4bpf4_4core_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
      }
      __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
    }
    __pyx_pybuffernd_intersection.diminfo[0].strides = __pyx_pybuffernd_intersection.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_intersection.diminfo[0].shape = __pyx_pybuffernd_intersection.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 4951, __pyx_L1_error)
  }
  __pyx_v_intersection = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4952
 *         intersect_n = _dxton(dx, intersect_x0_quant, intersect_x1_quant)
 *         intersection = self.bpf.mapn_between(intersect_n, intersect_x0_quant, intersect_x1_quant)
 *         cdef DTYPE_t *intersection_data = <DTYPE_t*>(intersection.data)             # <<<<<<<<<<<<<<
 *         cdef double intersect_dx = _ntodx(intersect_n, intersect_x0_quant, intersect_x1_quant)
 *         # print("dx: %f, intersect_dx: %f, intersect_x1: %f, intersect_x1_quant: %f, x1: %f, diff:%f" % (dx, intersect_dx, intersect_x1, intersect_x1_quant, x1, diff))
 */
  __pyx_v_intersection_data = ((__pyx_t_4bpf4_4core_DTYPE_t *)__pyx_v_intersection->data);

  /* "bpf4/core.pyx":4953
 *         intersection = self.bpf.mapn_between(intersect_n, intersect_x0_quant, intersect_x1_quant)
 *         cdef DTYPE_t *intersection_data = <DTYPE_t*>(intersection.data)
 *         cdef double intersect_dx = _ntodx(intersect_n, intersect_x0_quant, intersect_x1_quant)             # <<<<<<<<<<<<<<
 *         # print("dx: %f, intersect_dx: %f, intersect_x1: %f, intersect_x1_quant: %f, x1: %f, diff:%f" % (dx, intersect_dx, intersect_x1, intersect_x1_quant, x1, diff))
 *         for j in range(intersect_n):
 */
  __pyx_v_intersect_dx = __pyx_f_4bpf4_4core__ntodx(__pyx_v_intersect_n, __pyx_v_intersect_x0_quant, __pyx_v_intersect_x1_quant);

  /* "bpf4/core.pyx":4955
 *         cdef double intersect_dx = _ntodx(intersect_n, intersect_x0_quant, intersect_x1_quant)
 *         # print("dx: %f, intersect_dx: %f, intersect_x1: %f, intersect_x1_quant: %f, x1: %f, diff:%f" % (dx, intersect_dx, intersect_x1, intersect_x1_quant, x1, diff))
 *         for j in range(intersect_n):             # <<<<<<<<<<<<<<
 *             A[i+j] = intersection_data[j]
 * 
 */
  __pyx_t_8 = __pyx_v_intersect_n;
  __pyx_t_14 = __pyx_t_8;
  for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
    __pyx_v_j = __pyx_t_15;

    /* "bpf4/core.pyx":4956
 *         # print("dx: %f, intersect_dx: %f, intersect_x1: %f, intersect_x1_quant: %f, x1: %f, diff:%f" % (dx, intersect_dx, intersect_x1, intersect_x1_quant, x1, diff))
 *         for j in range(intersect_n):
 *             A[i+j] = intersection_data[j]             # <<<<<<<<<<<<<<
 * 
 *         y1 = self._y1
 */
    __pyx_t_22 = (__pyx_v_i + __pyx_v_j);
    *__Pyx_BufPtrStrided1d(__pyx_t_4bpf4_4core_DTYPE_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_A.diminfo[0].strides) = (__pyx_v_intersection_data[__pyx_v_j]);
  }

  /* "bpf4/core.pyx":4958
 *             A[i+j] = intersection_data[j]
 * 
 *         y1 = self._y1             # <<<<<<<<<<<<<<
 *         for j in range(i+intersect_n, n):
 *             data[j] = y1
 */
  __pyx_t_17 = __pyx_v_self->_y1;
  __pyx_v_y1 = __pyx_t_17;

  /* "bpf4/core.pyx":4959
 * 
 *         y1 = self._y1
 *         for j in range(i+intersect_n, n):             # <<<<<<<<<<<<<<
 *             data[j] = y1
 * 
 */
  __pyx_t_8 = __pyx_v_n;
  __pyx_t_14 = __pyx_t_8;
  for (__pyx_t_15 = (__pyx_v_i + __pyx_v_intersect_n); __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
    __pyx_v_j = __pyx_t_15;

    /* "bpf4/core.pyx":4960
 *         y1 = self._y1
 *         for j in range(i+intersect_n, n):
 *             data[j] = y1             # <<<<<<<<<<<<<<
 * 
 *         return A
 */
    (__pyx_v_data[__pyx_v_j]) = __pyx_v_y1;
  }

  /* "bpf4/core.pyx":4962
 *             data[j] = y1
 * 
 *         return A             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_A));
  __pyx_r = ((PyArrayObject *)__pyx_v_A);
  goto __pyx_L0;

  /* "bpf4/core.pyx":4918
 *         return integr0 + integr1 + integr2
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if self.outbound_mode == OUTBOUND_DONOTHING:
 *             return self.bpf.mapn_between(n, x0, x1, out)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intersection.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("bpf4.core._BpfCrop.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intersection.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_A);
  __Pyx_XDECREF((PyObject *)__pyx_v_intersection);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_11mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_8_BpfCrop_10mapn_between[] = "_BpfCrop.mapn_between(self, int n, double x0, double x1, ndarray out=None) -> ndarray";
static PyMethodDef __pyx_mdef_4bpf4_4core_8_BpfCrop_11mapn_between = {"mapn_between", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_8_BpfCrop_11mapn_between, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_8_BpfCrop_10mapn_between};
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_11mapn_between(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_n;
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapn_between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_out,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = (PyObject *)((PyArrayObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 1); __PYX_ERR(0, 4918, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, 2); __PYX_ERR(0, 4918, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapn_between") < 0)) __PYX_ERR(0, 4918, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4918, __pyx_L3_error)
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4918, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4918, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapn_between", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4918, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfCrop.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 4918, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_8_BpfCrop_10mapn_between(((struct __pyx_obj_4bpf4_4core__BpfCrop *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_10mapn_between(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self, int __pyx_v_n, double __pyx_v_x0, double __pyx_v_x1, PyArrayObject *__pyx_v_out) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapn_between", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.out = __pyx_v_out;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4bpf4_4core__BpfCrop->__pyx_base.mapn_between(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_n, __pyx_v_x0, __pyx_v_x1, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfCrop.mapn_between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4859
 * cdef class _BpfCrop(BpfInterface):
 *     cdef BpfInterface bpf
 *     cdef readonly double _y0, _y1             # <<<<<<<<<<<<<<
 *     cdef readonly int outbound_mode
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_3_y0_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_3_y0_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_8_BpfCrop_3_y0___get__(((struct __pyx_obj_4bpf4_4core__BpfCrop *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_3_y0___get__(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_y0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfCrop._y0.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_3_y1_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_3_y1_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_8_BpfCrop_3_y1___get__(((struct __pyx_obj_4bpf4_4core__BpfCrop *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_3_y1___get__(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_y1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfCrop._y1.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4860
 *     cdef BpfInterface bpf
 *     cdef readonly double _y0, _y1
 *     cdef readonly int outbound_mode             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_13outbound_mode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_4bpf4_4core_8_BpfCrop_13outbound_mode_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_8_BpfCrop_13outbound_mode___get__(((struct __pyx_obj_4bpf4_4core__BpfCrop *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_13outbound_mode___get__(struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->outbound_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfCrop.outbound_mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":4965
 * 
 * 
 * cpdef _BpfCrop _BpfCrop_new(BpfInterface bpf, double x0, double x1, int outbound_mode,             # <<<<<<<<<<<<<<
 *                             double outbound0=0, double outbound1=0):
 *     """
 */

static PyObject *__pyx_pw_4bpf4_4core_9_BpfCrop_new(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_f_4bpf4_4core__BpfCrop_new(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, double __pyx_v_x0, double __pyx_v_x1, int __pyx_v_outbound_mode, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core__BpfCrop_new *__pyx_optional_args) {
  double __pyx_v_outbound0 = ((double)0.0);
  double __pyx_v_outbound1 = ((double)0.0);
  struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_v_self = NULL;
  struct __pyx_obj_4bpf4_4core__BpfCrop *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_BpfCrop_new", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_outbound0 = __pyx_optional_args->outbound0;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_outbound1 = __pyx_optional_args->outbound1;
      }
    }
  }

  /* "bpf4/core.pyx":4976
 *          2: set. in this case the last parameters outbount0 and outbound1 are used when called outside the bounds
 *     """
 *     self = _BpfCrop()             # <<<<<<<<<<<<<<
 *     self._set_bounds(x0, x1)
 *     self.bpf = bpf
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4bpf4_4core__BpfCrop)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_self = ((struct __pyx_obj_4bpf4_4core__BpfCrop *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":4977
 *     """
 *     self = _BpfCrop()
 *     self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 *     self.bpf = bpf
 *     # -1: use the default, 0: do nothing, call __ccall__ each time,
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":4978
 *     self = _BpfCrop()
 *     self._set_bounds(x0, x1)
 *     self.bpf = bpf             # <<<<<<<<<<<<<<
 *     # -1: use the default, 0: do nothing, call __ccall__ each time,
 *     # 1: cache y0 and y1 for values outside the bounds,
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_bpf));
  __Pyx_GOTREF(__pyx_v_self->bpf);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->bpf));
  __pyx_v_self->bpf = __pyx_v_bpf;

  /* "bpf4/core.pyx":4982
 *     # 1: cache y0 and y1 for values outside the bounds,
 *     # 2: set y0 and y1 for values outside the bounds
 *     if outbound_mode == OUTBOUND_DEFAULT:             # <<<<<<<<<<<<<<
 *         outbound_mode = CONFIG['crop.outbound_mode']
 *     self.outbound_mode = outbound_mode
 */
  __pyx_t_2 = ((__pyx_v_outbound_mode == -1L) != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":4983
 *     # 2: set y0 and y1 for values outside the bounds
 *     if outbound_mode == OUTBOUND_DEFAULT:
 *         outbound_mode = CONFIG['crop.outbound_mode']             # <<<<<<<<<<<<<<
 *     self.outbound_mode = outbound_mode
 *     if outbound_mode == OUTBOUND_CACHE:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CONFIG); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_kp_u_crop_outbound_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4983, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_outbound_mode = __pyx_t_4;

    /* "bpf4/core.pyx":4982
 *     # 1: cache y0 and y1 for values outside the bounds,
 *     # 2: set y0 and y1 for values outside the bounds
 *     if outbound_mode == OUTBOUND_DEFAULT:             # <<<<<<<<<<<<<<
 *         outbound_mode = CONFIG['crop.outbound_mode']
 *     self.outbound_mode = outbound_mode
 */
  }

  /* "bpf4/core.pyx":4984
 *     if outbound_mode == OUTBOUND_DEFAULT:
 *         outbound_mode = CONFIG['crop.outbound_mode']
 *     self.outbound_mode = outbound_mode             # <<<<<<<<<<<<<<
 *     if outbound_mode == OUTBOUND_CACHE:
 *         self._y0 = self.bpf.__ccall__(x0)
 */
  __pyx_v_self->outbound_mode = __pyx_v_outbound_mode;

  /* "bpf4/core.pyx":4985
 *         outbound_mode = CONFIG['crop.outbound_mode']
 *     self.outbound_mode = outbound_mode
 *     if outbound_mode == OUTBOUND_CACHE:             # <<<<<<<<<<<<<<
 *         self._y0 = self.bpf.__ccall__(x0)
 *         self._y1 = self.bpf.__ccall__(x1)
 */
  switch (__pyx_v_outbound_mode) {
    case 1:

    /* "bpf4/core.pyx":4986
 *     self.outbound_mode = outbound_mode
 *     if outbound_mode == OUTBOUND_CACHE:
 *         self._y0 = self.bpf.__ccall__(x0)             # <<<<<<<<<<<<<<
 *         self._y1 = self.bpf.__ccall__(x1)
 *     elif outbound_mode == OUTBOUND_SET:
 */
    __pyx_v_self->_y0 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x0);

    /* "bpf4/core.pyx":4987
 *     if outbound_mode == OUTBOUND_CACHE:
 *         self._y0 = self.bpf.__ccall__(x0)
 *         self._y1 = self.bpf.__ccall__(x1)             # <<<<<<<<<<<<<<
 *     elif outbound_mode == OUTBOUND_SET:
 *         self._y0 = outbound0
 */
    __pyx_v_self->_y1 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->bpf, __pyx_v_x1);

    /* "bpf4/core.pyx":4985
 *         outbound_mode = CONFIG['crop.outbound_mode']
 *     self.outbound_mode = outbound_mode
 *     if outbound_mode == OUTBOUND_CACHE:             # <<<<<<<<<<<<<<
 *         self._y0 = self.bpf.__ccall__(x0)
 *         self._y1 = self.bpf.__ccall__(x1)
 */
    break;
    case 2:

    /* "bpf4/core.pyx":4989
 *         self._y1 = self.bpf.__ccall__(x1)
 *     elif outbound_mode == OUTBOUND_SET:
 *         self._y0 = outbound0             # <<<<<<<<<<<<<<
 *         self._y1 = outbound1
 *     return self
 */
    __pyx_v_self->_y0 = __pyx_v_outbound0;

    /* "bpf4/core.pyx":4990
 *     elif outbound_mode == OUTBOUND_SET:
 *         self._y0 = outbound0
 *         self._y1 = outbound1             # <<<<<<<<<<<<<<
 *     return self
 * 
 */
    __pyx_v_self->_y1 = __pyx_v_outbound1;

    /* "bpf4/core.pyx":4988
 *         self._y0 = self.bpf.__ccall__(x0)
 *         self._y1 = self.bpf.__ccall__(x1)
 *     elif outbound_mode == OUTBOUND_SET:             # <<<<<<<<<<<<<<
 *         self._y0 = outbound0
 *         self._y1 = outbound1
 */
    break;
    default: break;
  }

  /* "bpf4/core.pyx":4991
 *         self._y0 = outbound0
 *         self._y1 = outbound1
 *     return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "bpf4/core.pyx":4965
 * 
 * 
 * cpdef _BpfCrop _BpfCrop_new(BpfInterface bpf, double x0, double x1, int outbound_mode,             # <<<<<<<<<<<<<<
 *                             double outbound0=0, double outbound1=0):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core._BpfCrop_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_9_BpfCrop_new(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_8_BpfCrop_new[] = "_BpfCrop_new(BpfInterface bpf, double x0, double x1, int outbound_mode, double outbound0=0, double outbound1=0) -> _BpfCrop\n\n    create a cropped bpf. \n    \n    outbound_mode:\n        -1: use the default\n         0: do nothing. in this case, the bpf is evaluated at the cropping point each time it is called outside the bounds\n         1: cache the values. the values at the bounds are cached and returned when an outbound call takes place\n         2: set. in this case the last parameters outbount0 and outbound1 are used when called outside the bounds\n    ";
static PyMethodDef __pyx_mdef_4bpf4_4core_9_BpfCrop_new = {"_BpfCrop_new", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_9_BpfCrop_new, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_8_BpfCrop_new};
static PyObject *__pyx_pw_4bpf4_4core_9_BpfCrop_new(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf = 0;
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_v_outbound_mode;
  double __pyx_v_outbound0;
  double __pyx_v_outbound1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_BpfCrop_new (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bpf,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_outbound_mode,&__pyx_n_s_outbound0,&__pyx_n_s_outbound1,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_BpfCrop_new", 0, 4, 6, 1); __PYX_ERR(0, 4965, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_BpfCrop_new", 0, 4, 6, 2); __PYX_ERR(0, 4965, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outbound_mode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_BpfCrop_new", 0, 4, 6, 3); __PYX_ERR(0, 4965, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outbound0);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outbound1);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_BpfCrop_new") < 0)) __PYX_ERR(0, 4965, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4965, __pyx_L3_error)
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4965, __pyx_L3_error)
    __pyx_v_outbound_mode = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_outbound_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4965, __pyx_L3_error)
    if (values[4]) {
      __pyx_v_outbound0 = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_outbound0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4966, __pyx_L3_error)
    } else {
      __pyx_v_outbound0 = ((double)0.0);
    }
    if (values[5]) {
      __pyx_v_outbound1 = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_outbound1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 4966, __pyx_L3_error)
    } else {
      __pyx_v_outbound1 = ((double)0.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_BpfCrop_new", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4965, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfCrop_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bpf), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "bpf", 0))) __PYX_ERR(0, 4965, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_8_BpfCrop_new(__pyx_self, __pyx_v_bpf, __pyx_v_x0, __pyx_v_x1, __pyx_v_outbound_mode, __pyx_v_outbound0, __pyx_v_outbound1);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_8_BpfCrop_new(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, double __pyx_v_x0, double __pyx_v_x1, int __pyx_v_outbound_mode, double __pyx_v_outbound0, double __pyx_v_outbound1) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core__BpfCrop_new __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_BpfCrop_new", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.outbound0 = __pyx_v_outbound0;
  __pyx_t_2.outbound1 = __pyx_v_outbound1;
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core__BpfCrop_new(__pyx_v_bpf, __pyx_v_x0, __pyx_v_x1, __pyx_v_outbound_mode, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._BpfCrop_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":5000
 *     cdef int _numbpfs
 * 
 *     def __init__(self, bpfs):             # <<<<<<<<<<<<<<
 *         self._numbpfs = len(bpfs)
 *         self._bpfs = tuple(bpfs)
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_13_MultipleBpfs_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_13_MultipleBpfs_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bpfs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bpfs,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpfs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 5000, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_bpfs = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5000, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._MultipleBpfs.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_13_MultipleBpfs___init__(((struct __pyx_obj_4bpf4_4core__MultipleBpfs *)__pyx_v_self), __pyx_v_bpfs);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_13_MultipleBpfs___init__(struct __pyx_obj_4bpf4_4core__MultipleBpfs *__pyx_v_self, PyObject *__pyx_v_bpfs) {
  int __pyx_v_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":5001
 * 
 *     def __init__(self, bpfs):
 *         self._numbpfs = len(bpfs)             # <<<<<<<<<<<<<<
 *         self._bpfs = tuple(bpfs)
 *         self._calculate_bounds()
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_bpfs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5001, __pyx_L1_error)
  __pyx_v_self->_numbpfs = __pyx_t_1;

  /* "bpf4/core.pyx":5002
 *     def __init__(self, bpfs):
 *         self._numbpfs = len(bpfs)
 *         self._bpfs = tuple(bpfs)             # <<<<<<<<<<<<<<
 *         self._calculate_bounds()
 *         self.bpfpointers = <void**>malloc(sizeof(void*) * self._numbpfs)
 */
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_bpfs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_bpfs);
  __Pyx_DECREF(__pyx_v_self->_bpfs);
  __pyx_v_self->_bpfs = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "bpf4/core.pyx":5003
 *         self._numbpfs = len(bpfs)
 *         self._bpfs = tuple(bpfs)
 *         self._calculate_bounds()             # <<<<<<<<<<<<<<
 *         self.bpfpointers = <void**>malloc(sizeof(void*) * self._numbpfs)
 *         cdef int i
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calculate_bounds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bpf4/core.pyx":5004
 *         self._bpfs = tuple(bpfs)
 *         self._calculate_bounds()
 *         self.bpfpointers = <void**>malloc(sizeof(void*) * self._numbpfs)             # <<<<<<<<<<<<<<
 *         cdef int i
 *         for i in range(self._numbpfs):
 */
  __pyx_v_self->bpfpointers = ((void **)malloc(((sizeof(void *)) * __pyx_v_self->_numbpfs)));

  /* "bpf4/core.pyx":5006
 *         self.bpfpointers = <void**>malloc(sizeof(void*) * self._numbpfs)
 *         cdef int i
 *         for i in range(self._numbpfs):             # <<<<<<<<<<<<<<
 *             self.bpfpointers[i] = <void*>bpfs[i]
 * 
 */
  __pyx_t_5 = __pyx_v_self->_numbpfs;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "bpf4/core.pyx":5007
 *         cdef int i
 *         for i in range(self._numbpfs):
 *             self.bpfpointers[i] = <void*>bpfs[i]             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bpfs, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    (__pyx_v_self->bpfpointers[__pyx_v_i]) = ((void *)__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "bpf4/core.pyx":5000
 *     cdef int _numbpfs
 * 
 *     def __init__(self, bpfs):             # <<<<<<<<<<<<<<
 *         self._numbpfs = len(bpfs)
 *         self._bpfs = tuple(bpfs)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bpf4.core._MultipleBpfs.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":5009
 *             self.bpfpointers[i] = <void*>bpfs[i]
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.bpfpointers)
 * 
 */

/* Python wrapper */
static void __pyx_pw_4bpf4_4core_13_MultipleBpfs_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_4bpf4_4core_13_MultipleBpfs_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_4bpf4_4core_13_MultipleBpfs_2__dealloc__(((struct __pyx_obj_4bpf4_4core__MultipleBpfs *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_4bpf4_4core_13_MultipleBpfs_2__dealloc__(struct __pyx_obj_4bpf4_4core__MultipleBpfs *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "bpf4/core.pyx":5010
 * 
 *     def __dealloc__(self):
 *         free(self.bpfpointers)             # <<<<<<<<<<<<<<
 * 
 *     def _calculate_bounds(self):
 */
  free(__pyx_v_self->bpfpointers);

  /* "bpf4/core.pyx":5009
 *             self.bpfpointers[i] = <void*>bpfs[i]
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.bpfpointers)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "bpf4/core.pyx":5012
 *         free(self.bpfpointers)
 * 
 *     def _calculate_bounds(self):             # <<<<<<<<<<<<<<
 *         cdef double bounds0, bounds1
 *         cdef double x0=INF, x1=INFNEG
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_MultipleBpfs_5_calculate_bounds(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_13_MultipleBpfs_4_calculate_bounds[] = "_MultipleBpfs._calculate_bounds(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_13_MultipleBpfs_5_calculate_bounds = {"_calculate_bounds", (PyCFunction)__pyx_pw_4bpf4_4core_13_MultipleBpfs_5_calculate_bounds, METH_NOARGS, __pyx_doc_4bpf4_4core_13_MultipleBpfs_4_calculate_bounds};
static PyObject *__pyx_pw_4bpf4_4core_13_MultipleBpfs_5_calculate_bounds(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calculate_bounds (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_13_MultipleBpfs_4_calculate_bounds(((struct __pyx_obj_4bpf4_4core__MultipleBpfs *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_MultipleBpfs_4_calculate_bounds(struct __pyx_obj_4bpf4_4core__MultipleBpfs *__pyx_v_self) {
  double __pyx_v_x0;
  double __pyx_v_x1;
  PyObject *__pyx_v_bpf = NULL;
  PyObject *__pyx_v_bound0 = NULL;
  PyObject *__pyx_v_bound1 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  double __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_calculate_bounds", 0);

  /* "bpf4/core.pyx":5014
 *     def _calculate_bounds(self):
 *         cdef double bounds0, bounds1
 *         cdef double x0=INF, x1=INFNEG             # <<<<<<<<<<<<<<
 *         for bpf in self._bpfs:
 *             bound0, bound1 = bpf.bounds()
 */
  __pyx_v_x0 = Py_HUGE_VAL;
  __pyx_v_x1 = (-Py_HUGE_VAL);

  /* "bpf4/core.pyx":5015
 *         cdef double bounds0, bounds1
 *         cdef double x0=INF, x1=INFNEG
 *         for bpf in self._bpfs:             # <<<<<<<<<<<<<<
 *             bound0, bound1 = bpf.bounds()
 *             if bound0 < x0:
 */
  if (unlikely(__pyx_v_self->_bpfs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 5015, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->_bpfs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 5015, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_bpf, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "bpf4/core.pyx":5016
 *         cdef double x0=INF, x1=INFNEG
 *         for bpf in self._bpfs:
 *             bound0, bound1 = bpf.bounds()             # <<<<<<<<<<<<<<
 *             if bound0 < x0:
 *                 x0 = bound0
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_bpf, __pyx_n_s_bounds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 5016, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5016, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5016, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5016, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 5016, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 5016, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_bound0, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_bound1, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "bpf4/core.pyx":5017
 *         for bpf in self._bpfs:
 *             bound0, bound1 = bpf.bounds()
 *             if bound0 < x0:             # <<<<<<<<<<<<<<
 *                 x0 = bound0
 *             if bound1 > x1:
 */
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_bound0, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5017, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 5017, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_8) {

      /* "bpf4/core.pyx":5018
 *             bound0, bound1 = bpf.bounds()
 *             if bound0 < x0:
 *                 x0 = bound0             # <<<<<<<<<<<<<<
 *             if bound1 > x1:
 *                 x1 = bound1
 */
      __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_bound0); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5018, __pyx_L1_error)
      __pyx_v_x0 = __pyx_t_9;

      /* "bpf4/core.pyx":5017
 *         for bpf in self._bpfs:
 *             bound0, bound1 = bpf.bounds()
 *             if bound0 < x0:             # <<<<<<<<<<<<<<
 *                 x0 = bound0
 *             if bound1 > x1:
 */
    }

    /* "bpf4/core.pyx":5019
 *             if bound0 < x0:
 *                 x0 = bound0
 *             if bound1 > x1:             # <<<<<<<<<<<<<<
 *                 x1 = bound1
 *         self._set_bounds(x0, x1)
 */
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_bound1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5019, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 5019, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_8) {

      /* "bpf4/core.pyx":5020
 *                 x0 = bound0
 *             if bound1 > x1:
 *                 x1 = bound1             # <<<<<<<<<<<<<<
 *         self._set_bounds(x0, x1)
 * 
 */
      __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_bound1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5020, __pyx_L1_error)
      __pyx_v_x1 = __pyx_t_9;

      /* "bpf4/core.pyx":5019
 *             if bound0 < x0:
 *                 x0 = bound0
 *             if bound1 > x1:             # <<<<<<<<<<<<<<
 *                 x1 = bound1
 *         self._set_bounds(x0, x1)
 */
    }

    /* "bpf4/core.pyx":5015
 *         cdef double bounds0, bounds1
 *         cdef double x0=INF, x1=INFNEG
 *         for bpf in self._bpfs:             # <<<<<<<<<<<<<<
 *             bound0, bound1 = bpf.bounds()
 *             if bound0 < x0:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":5021
 *             if bound1 > x1:
 *                 x1 = bound1
 *         self._set_bounds(x0, x1)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self): return (self._bpfs,)
 */
  __pyx_f_4bpf4_4core_12BpfInterface__set_bounds(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_self), __pyx_v_x0, __pyx_v_x1);

  /* "bpf4/core.pyx":5012
 *         free(self.bpfpointers)
 * 
 *     def _calculate_bounds(self):             # <<<<<<<<<<<<<<
 *         cdef double bounds0, bounds1
 *         cdef double x0=INF, x1=INFNEG
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core._MultipleBpfs._calculate_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bpf);
  __Pyx_XDECREF(__pyx_v_bound0);
  __Pyx_XDECREF(__pyx_v_bound1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":5023
 *         self._set_bounds(x0, x1)
 * 
 *     def __getstate__(self): return (self._bpfs,)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13_MultipleBpfs_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_4bpf4_4core_13_MultipleBpfs_6__getstate__[] = "_MultipleBpfs.__getstate__(self)";
static PyMethodDef __pyx_mdef_4bpf4_4core_13_MultipleBpfs_7__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_13_MultipleBpfs_7__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_13_MultipleBpfs_6__getstate__};
static PyObject *__pyx_pw_4bpf4_4core_13_MultipleBpfs_7__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_4bpf4_4core_13_MultipleBpfs_6__getstate__(((struct __pyx_obj_4bpf4_4core__MultipleBpfs *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_13_MultipleBpfs_6__getstate__(struct __pyx_obj_4bpf4_4core__MultipleBpfs *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->_bpfs);
  __Pyx_GIVEREF(__pyx_v_self->_bpfs);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_bpfs);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core._MultipleBpfs.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":5025
 *     def __getstate__(self): return (self._bpfs,)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         with gil:
 *             raise NotImplementedError
 */

static double __pyx_f_4bpf4_4core_13_MultipleBpfs___ccall__(CYTHON_UNUSED struct __pyx_obj_4bpf4_4core__MultipleBpfs *__pyx_v_self, CYTHON_UNUSED double __pyx_v_x) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("__ccall__", 0);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif

  /* "bpf4/core.pyx":5026
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         with gil:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError
 * 
 */
  /*try:*/ {
    {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
        #endif
        /*try:*/ {

          /* "bpf4/core.pyx":5027
 *     cdef double __ccall__(self, double x) nogil:
 *         with gil:
 *             raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
          __PYX_ERR(0, 5027, __pyx_L7_error)
        }

        /* "bpf4/core.pyx":5026
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         with gil:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError
 * 
 */
        /*finally:*/ {
          __pyx_L7_error: {
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            goto __pyx_L4_error;
          }
        }
    }
  }
  /*finally:*/ {
    __pyx_L4_error: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L1_error;
    }
  }

  /* "bpf4/core.pyx":5025
 *     def __getstate__(self): return (self._bpfs,)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         with gil:
 *             raise NotImplementedError
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("bpf4.core._MultipleBpfs.__ccall__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
  __pyx_r = 0;
  __pyx_L0:;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "bpf4/core.pyx":5043
 *     ![](assets/Max.png)
 *     """
 *     def __init__(self, *bpfs):             # <<<<<<<<<<<<<<
 *         if len(bpfs) == 1 and isinstance(bpfs[0], (list, tuple)):
 *             bpfs = bpfs[0]
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_3Max_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_3Max_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bpfs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_bpfs = __pyx_args;
  __pyx_r = __pyx_pf_4bpf4_4core_3Max___init__(((struct __pyx_obj_4bpf4_4core_Max *)__pyx_v_self), __pyx_v_bpfs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_bpfs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_3Max___init__(struct __pyx_obj_4bpf4_4core_Max *__pyx_v_self, PyObject *__pyx_v_bpfs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_bpfs);

  /* "bpf4/core.pyx":5044
 *     """
 *     def __init__(self, *bpfs):
 *         if len(bpfs) == 1 and isinstance(bpfs[0], (list, tuple)):             # <<<<<<<<<<<<<<
 *             bpfs = bpfs[0]
 *         _MultipleBpfs.__init__(self, bpfs)
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_bpfs); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5044, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_2 == 1) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_bpfs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyList_Check(__pyx_t_4); 
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_6 = PyTuple_Check(__pyx_t_4); 
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":5045
 *     def __init__(self, *bpfs):
 *         if len(bpfs) == 1 and isinstance(bpfs[0], (list, tuple)):
 *             bpfs = bpfs[0]             # <<<<<<<<<<<<<<
 *         _MultipleBpfs.__init__(self, bpfs)
 * 
 */
    __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_bpfs, 0);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_bpfs, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "bpf4/core.pyx":5044
 *     """
 *     def __init__(self, *bpfs):
 *         if len(bpfs) == 1 and isinstance(bpfs[0], (list, tuple)):             # <<<<<<<<<<<<<<
 *             bpfs = bpfs[0]
 *         _MultipleBpfs.__init__(self, bpfs)
 */
  }

  /* "bpf4/core.pyx":5046
 *         if len(bpfs) == 1 and isinstance(bpfs[0], (list, tuple)):
 *             bpfs = bpfs[0]
 *         _MultipleBpfs.__init__(self, bpfs)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core__MultipleBpfs), __pyx_n_s_init); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_v_bpfs};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5046, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_v_bpfs};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5046, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5046, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_bpfs);
    __Pyx_GIVEREF(__pyx_v_bpfs);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_bpfs);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5046, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "bpf4/core.pyx":5043
 *     ![](assets/Max.png)
 *     """
 *     def __init__(self, *bpfs):             # <<<<<<<<<<<<<<
 *         if len(bpfs) == 1 and isinstance(bpfs[0], (list, tuple)):
 *             bpfs = bpfs[0]
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("bpf4.core.Max.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bpfs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":5048
 *         _MultipleBpfs.__init__(self, bpfs)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double y = INFNEG
 *         cdef double res
 */

static double __pyx_f_4bpf4_4core_3Max___ccall__(struct __pyx_obj_4bpf4_4core_Max *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_y;
  double __pyx_v_res;
  int __pyx_v_i;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("__ccall__", 0);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif

  /* "bpf4/core.pyx":5049
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double y = INFNEG             # <<<<<<<<<<<<<<
 *         cdef double res
 *         cdef int i
 */
  /*try:*/ {
    __pyx_v_y = (-Py_HUGE_VAL);

    /* "bpf4/core.pyx":5052
 *         cdef double res
 *         cdef int i
 *         for i in range(self._numbpfs):             # <<<<<<<<<<<<<<
 *             with gil:
 *                 self.tmp = <BpfInterface>(self.bpfpointers[i])
 */
    __pyx_t_1 = __pyx_v_self->__pyx_base._numbpfs;
    __pyx_t_2 = __pyx_t_1;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "bpf4/core.pyx":5053
 *         cdef int i
 *         for i in range(self._numbpfs):
 *             with gil:             # <<<<<<<<<<<<<<
 *                 self.tmp = <BpfInterface>(self.bpfpointers[i])
 *             res = self.tmp.__ccall__(x)
 */
      {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          #endif
          /*try:*/ {

            /* "bpf4/core.pyx":5054
 *         for i in range(self._numbpfs):
 *             with gil:
 *                 self.tmp = <BpfInterface>(self.bpfpointers[i])             # <<<<<<<<<<<<<<
 *             res = self.tmp.__ccall__(x)
 *             if res > y:
 */
            __pyx_t_4 = ((PyObject *)(__pyx_v_self->__pyx_base.bpfpointers[__pyx_v_i]));
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GOTREF(__pyx_v_self->__pyx_base.tmp);
            __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.tmp));
            __pyx_v_self->__pyx_base.tmp = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_4);
            __pyx_t_4 = 0;
          }

          /* "bpf4/core.pyx":5053
 *         cdef int i
 *         for i in range(self._numbpfs):
 *             with gil:             # <<<<<<<<<<<<<<
 *                 self.tmp = <BpfInterface>(self.bpfpointers[i])
 *             res = self.tmp.__ccall__(x)
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_PyGILState_Release(__pyx_gilstate_save);
              #endif
              goto __pyx_L12;
            }
            __pyx_L12:;
          }
      }

      /* "bpf4/core.pyx":5055
 *             with gil:
 *                 self.tmp = <BpfInterface>(self.bpfpointers[i])
 *             res = self.tmp.__ccall__(x)             # <<<<<<<<<<<<<<
 *             if res > y:
 *                 y = res
 */
      __pyx_v_res = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->__pyx_base.tmp->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->__pyx_base.tmp, __pyx_v_x);

      /* "bpf4/core.pyx":5056
 *                 self.tmp = <BpfInterface>(self.bpfpointers[i])
 *             res = self.tmp.__ccall__(x)
 *             if res > y:             # <<<<<<<<<<<<<<
 *                 y = res
 *         return y
 */
      __pyx_t_5 = ((__pyx_v_res > __pyx_v_y) != 0);
      if (__pyx_t_5) {

        /* "bpf4/core.pyx":5057
 *             res = self.tmp.__ccall__(x)
 *             if res > y:
 *                 y = res             # <<<<<<<<<<<<<<
 *         return y
 * 
 */
        __pyx_v_y = __pyx_v_res;

        /* "bpf4/core.pyx":5056
 *                 self.tmp = <BpfInterface>(self.bpfpointers[i])
 *             res = self.tmp.__ccall__(x)
 *             if res > y:             # <<<<<<<<<<<<<<
 *                 y = res
 *         return y
 */
      }
    }

    /* "bpf4/core.pyx":5058
 *             if res > y:
 *                 y = res
 *         return y             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = __pyx_v_y;
    goto __pyx_L3_return;
  }

  /* "bpf4/core.pyx":5049
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double y = INFNEG             # <<<<<<<<<<<<<<
 *         cdef double res
 *         cdef int i
 */
  /*finally:*/ {
    __pyx_L3_return: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L0;
    }
  }

  /* "bpf4/core.pyx":5048
 *         _MultipleBpfs.__init__(self, bpfs)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double y = INFNEG
 *         cdef double res
 */

  /* function exit code */
  __pyx_r = 0;
  __pyx_L0:;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "bpf4/core.pyx":5075
 * 
 *     """
 *     def __init__(self, *bpfs):             # <<<<<<<<<<<<<<
 *         if len(bpfs) == 1 and isinstance(bpfs[0], (list, tuple)):
 *             bpfs = bpfs[0]
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_3Min_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4bpf4_4core_3Min_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bpfs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_bpfs = __pyx_args;
  __pyx_r = __pyx_pf_4bpf4_4core_3Min___init__(((struct __pyx_obj_4bpf4_4core_Min *)__pyx_v_self), __pyx_v_bpfs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_bpfs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_3Min___init__(struct __pyx_obj_4bpf4_4core_Min *__pyx_v_self, PyObject *__pyx_v_bpfs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_bpfs);

  /* "bpf4/core.pyx":5076
 *     """
 *     def __init__(self, *bpfs):
 *         if len(bpfs) == 1 and isinstance(bpfs[0], (list, tuple)):             # <<<<<<<<<<<<<<
 *             bpfs = bpfs[0]
 *         _MultipleBpfs.__init__(self, bpfs)
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_bpfs); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5076, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_2 == 1) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_bpfs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyList_Check(__pyx_t_4); 
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_6 = PyTuple_Check(__pyx_t_4); 
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":5077
 *     def __init__(self, *bpfs):
 *         if len(bpfs) == 1 and isinstance(bpfs[0], (list, tuple)):
 *             bpfs = bpfs[0]             # <<<<<<<<<<<<<<
 *         _MultipleBpfs.__init__(self, bpfs)
 * 
 */
    __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_bpfs, 0);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_bpfs, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "bpf4/core.pyx":5076
 *     """
 *     def __init__(self, *bpfs):
 *         if len(bpfs) == 1 and isinstance(bpfs[0], (list, tuple)):             # <<<<<<<<<<<<<<
 *             bpfs = bpfs[0]
 *         _MultipleBpfs.__init__(self, bpfs)
 */
  }

  /* "bpf4/core.pyx":5078
 *         if len(bpfs) == 1 and isinstance(bpfs[0], (list, tuple)):
 *             bpfs = bpfs[0]
 *         _MultipleBpfs.__init__(self, bpfs)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core__MultipleBpfs), __pyx_n_s_init); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_v_bpfs};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5078, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_v_bpfs};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5078, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 5078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_bpfs);
    __Pyx_GIVEREF(__pyx_v_bpfs);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_bpfs);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "bpf4/core.pyx":5075
 * 
 *     """
 *     def __init__(self, *bpfs):             # <<<<<<<<<<<<<<
 *         if len(bpfs) == 1 and isinstance(bpfs[0], (list, tuple)):
 *             bpfs = bpfs[0]
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("bpf4.core.Min.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bpfs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":5080
 *         _MultipleBpfs.__init__(self, bpfs)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double y = INF
 *         cdef double res
 */

static double __pyx_f_4bpf4_4core_3Min___ccall__(struct __pyx_obj_4bpf4_4core_Min *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_y;
  double __pyx_v_res;
  int __pyx_v_i;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_tmp = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("__ccall__", 0);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif

  /* "bpf4/core.pyx":5081
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double y = INF             # <<<<<<<<<<<<<<
 *         cdef double res
 *         cdef int i
 */
  /*try:*/ {
    __pyx_v_y = Py_HUGE_VAL;

    /* "bpf4/core.pyx":5084
 *         cdef double res
 *         cdef int i
 *         for i in range(self._numbpfs):             # <<<<<<<<<<<<<<
 *             with gil:
 *                 tmp = <BpfInterface>(self.bpfpointers[i])
 */
    __pyx_t_1 = __pyx_v_self->__pyx_base._numbpfs;
    __pyx_t_2 = __pyx_t_1;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "bpf4/core.pyx":5085
 *         cdef int i
 *         for i in range(self._numbpfs):
 *             with gil:             # <<<<<<<<<<<<<<
 *                 tmp = <BpfInterface>(self.bpfpointers[i])
 *             res = tmp.__ccall__(x)
 */
      {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          #endif
          /*try:*/ {

            /* "bpf4/core.pyx":5086
 *         for i in range(self._numbpfs):
 *             with gil:
 *                 tmp = <BpfInterface>(self.bpfpointers[i])             # <<<<<<<<<<<<<<
 *             res = tmp.__ccall__(x)
 *             if res < y:
 */
            __pyx_t_4 = ((PyObject *)(__pyx_v_self->__pyx_base.bpfpointers[__pyx_v_i]));
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_XDECREF_SET(__pyx_v_tmp, ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_4));
            __pyx_t_4 = 0;
          }

          /* "bpf4/core.pyx":5085
 *         cdef int i
 *         for i in range(self._numbpfs):
 *             with gil:             # <<<<<<<<<<<<<<
 *                 tmp = <BpfInterface>(self.bpfpointers[i])
 *             res = tmp.__ccall__(x)
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_PyGILState_Release(__pyx_gilstate_save);
              #endif
              goto __pyx_L12;
            }
            __pyx_L12:;
          }
      }

      /* "bpf4/core.pyx":5087
 *             with gil:
 *                 tmp = <BpfInterface>(self.bpfpointers[i])
 *             res = tmp.__ccall__(x)             # <<<<<<<<<<<<<<
 *             if res < y:
 *                 y = res
 */
      __pyx_v_res = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_tmp->__pyx_vtab)->__pyx___ccall__(__pyx_v_tmp, __pyx_v_x);

      /* "bpf4/core.pyx":5088
 *                 tmp = <BpfInterface>(self.bpfpointers[i])
 *             res = tmp.__ccall__(x)
 *             if res < y:             # <<<<<<<<<<<<<<
 *                 y = res
 *         return y
 */
      __pyx_t_5 = ((__pyx_v_res < __pyx_v_y) != 0);
      if (__pyx_t_5) {

        /* "bpf4/core.pyx":5089
 *             res = tmp.__ccall__(x)
 *             if res < y:
 *                 y = res             # <<<<<<<<<<<<<<
 *         return y
 * 
 */
        __pyx_v_y = __pyx_v_res;

        /* "bpf4/core.pyx":5088
 *                 tmp = <BpfInterface>(self.bpfpointers[i])
 *             res = tmp.__ccall__(x)
 *             if res < y:             # <<<<<<<<<<<<<<
 *                 y = res
 *         return y
 */
      }
    }

    /* "bpf4/core.pyx":5090
 *             if res < y:
 *                 y = res
 *         return y             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = __pyx_v_y;
    goto __pyx_L3_return;
  }

  /* "bpf4/core.pyx":5081
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double y = INF             # <<<<<<<<<<<<<<
 *         cdef double res
 *         cdef int i
 */
  /*finally:*/ {
    __pyx_L3_return: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L0;
    }
  }

  /* "bpf4/core.pyx":5080
 *         _MultipleBpfs.__init__(self, bpfs)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double y = INF
 *         cdef double res
 */

  /* function exit code */
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_tmp);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "bpf4/core.pyx":5098
 *     cdef int numbpfs
 * 
 *     def __init__(self, which, bpfs, shape='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Interpolate between adjacent bpfs
 */

/* Python wrapper */
static int __pyx_pw_4bpf4_4core_10_BpfSelect_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_10_BpfSelect___init__[] = "\n        Interpolate between adjacent bpfs\n\n        Args:\n            which: a bpf mapping x->bpf index, where the index can\n                be fractionl and will interpolate between adjacent\n                bpfs\n            bpfs: the bpfs to select from\n            shape: the interpolation shape when dealing with fractional indexes\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_4bpf4_4core_10_BpfSelect___init__;
#endif
static int __pyx_pw_4bpf4_4core_10_BpfSelect_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which = 0;
  PyObject *__pyx_v_bpfs = 0;
  PyObject *__pyx_v_shape = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which,&__pyx_n_s_bpfs,&__pyx_n_s_shape,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)__pyx_n_u_linear);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpfs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 5098, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 5098, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_which = values[0];
    __pyx_v_bpfs = values[1];
    __pyx_v_shape = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5098, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core._BpfSelect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_10_BpfSelect___init__(((struct __pyx_obj_4bpf4_4core__BpfSelect *)__pyx_v_self), __pyx_v_which, __pyx_v_bpfs, __pyx_v_shape);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_4bpf4_4core_10_BpfSelect___init__(struct __pyx_obj_4bpf4_4core__BpfSelect *__pyx_v_self, PyObject *__pyx_v_which, PyObject *__pyx_v_bpfs, PyObject *__pyx_v_shape) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "bpf4/core.pyx":5109
 *             shape: the interpolation shape when dealing with fractional indexes
 *         """
 *         self.which = which             # <<<<<<<<<<<<<<
 *         self.numbpfs = len(bpfs)
 *         self.func = InterpolFunc_new_from_descriptor(shape)
 */
  if (!(likely(((__pyx_v_which) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_which, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 5109, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_which;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->which);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->which));
  __pyx_v_self->which = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bpf4/core.pyx":5110
 *         """
 *         self.which = which
 *         self.numbpfs = len(bpfs)             # <<<<<<<<<<<<<<
 *         self.func = InterpolFunc_new_from_descriptor(shape)
 *         _MultipleBpfs.__init__(self, bpfs)
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_bpfs); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 5110, __pyx_L1_error)
  __pyx_v_self->numbpfs = __pyx_t_2;

  /* "bpf4/core.pyx":5111
 *         self.which = which
 *         self.numbpfs = len(bpfs)
 *         self.func = InterpolFunc_new_from_descriptor(shape)             # <<<<<<<<<<<<<<
 *         _MultipleBpfs.__init__(self, bpfs)
 * 
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_v_shape))||((__pyx_v_shape) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_shape)->tp_name), 0))) __PYX_ERR(0, 5111, __pyx_L1_error)
  __pyx_v_self->func = __pyx_f_4bpf4_4core_InterpolFunc_new_from_descriptor(((PyObject*)__pyx_v_shape), NULL);

  /* "bpf4/core.pyx":5112
 *         self.numbpfs = len(bpfs)
 *         self.func = InterpolFunc_new_from_descriptor(shape)
 *         _MultipleBpfs.__init__(self, bpfs)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4bpf4_4core__MultipleBpfs), __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_bpfs};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5112, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_bpfs};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5112, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_bpfs);
    __Pyx_GIVEREF(__pyx_v_bpfs);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_bpfs);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":5098
 *     cdef int numbpfs
 * 
 *     def __init__(self, which, bpfs, shape='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Interpolate between adjacent bpfs
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bpf4.core._BpfSelect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":5114
 *         _MultipleBpfs.__init__(self, bpfs)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double index = self.which.__ccall__(x)
 *         cdef double y0, y1, x0
 */

static double __pyx_f_4bpf4_4core_10_BpfSelect___ccall__(struct __pyx_obj_4bpf4_4core__BpfSelect *__pyx_v_self, double __pyx_v_x) {
  double __pyx_v_index;
  double __pyx_v_y0;
  double __pyx_v_y1;
  double __pyx_v_x0;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b0 = NULL;
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b1 = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  void *__pyx_t_3;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("__ccall__", 0);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif

  /* "bpf4/core.pyx":5115
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double index = self.which.__ccall__(x)             # <<<<<<<<<<<<<<
 *         cdef double y0, y1, x0
 *         if index <= 0:
 */
  /*try:*/ {
    __pyx_v_index = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_self->which->__pyx_vtab)->__pyx___ccall__(__pyx_v_self->which, __pyx_v_x);

    /* "bpf4/core.pyx":5117
 *         cdef double index = self.which.__ccall__(x)
 *         cdef double y0, y1, x0
 *         if index <= 0:             # <<<<<<<<<<<<<<
 *             with gil:
 *                 b0 = <BpfInterface>(self.bpfpointers[0])
 */
    __pyx_t_1 = ((__pyx_v_index <= 0.0) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":5118
 *         cdef double y0, y1, x0
 *         if index <= 0:
 *             with gil:             # <<<<<<<<<<<<<<
 *                 b0 = <BpfInterface>(self.bpfpointers[0])
 *             return b0.__ccall__(x)
 */
      {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          #endif
          /*try:*/ {

            /* "bpf4/core.pyx":5119
 *         if index <= 0:
 *             with gil:
 *                 b0 = <BpfInterface>(self.bpfpointers[0])             # <<<<<<<<<<<<<<
 *             return b0.__ccall__(x)
 *         elif index >= self.numbpfs - 1:
 */
            __pyx_t_2 = ((PyObject *)(__pyx_v_self->__pyx_base.bpfpointers[0]));
            __Pyx_INCREF(__pyx_t_2);
            __pyx_v_b0 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
            __pyx_t_2 = 0;
          }

          /* "bpf4/core.pyx":5118
 *         cdef double y0, y1, x0
 *         if index <= 0:
 *             with gil:             # <<<<<<<<<<<<<<
 *                 b0 = <BpfInterface>(self.bpfpointers[0])
 *             return b0.__ccall__(x)
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_PyGILState_Release(__pyx_gilstate_save);
              #endif
              goto __pyx_L9;
            }
            __pyx_L9:;
          }
      }

      /* "bpf4/core.pyx":5120
 *             with gil:
 *                 b0 = <BpfInterface>(self.bpfpointers[0])
 *             return b0.__ccall__(x)             # <<<<<<<<<<<<<<
 *         elif index >= self.numbpfs - 1:
 *             with gil:
 */
      __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_b0->__pyx_vtab)->__pyx___ccall__(__pyx_v_b0, __pyx_v_x);
      goto __pyx_L3_return;

      /* "bpf4/core.pyx":5117
 *         cdef double index = self.which.__ccall__(x)
 *         cdef double y0, y1, x0
 *         if index <= 0:             # <<<<<<<<<<<<<<
 *             with gil:
 *                 b0 = <BpfInterface>(self.bpfpointers[0])
 */
    }

    /* "bpf4/core.pyx":5121
 *                 b0 = <BpfInterface>(self.bpfpointers[0])
 *             return b0.__ccall__(x)
 *         elif index >= self.numbpfs - 1:             # <<<<<<<<<<<<<<
 *             with gil:
 *                 b0 = <BpfInterface>(self.bpfpointers[self.numbpfs-1])
 */
    __pyx_t_1 = ((__pyx_v_index >= (__pyx_v_self->numbpfs - 1)) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":5122
 *             return b0.__ccall__(x)
 *         elif index >= self.numbpfs - 1:
 *             with gil:             # <<<<<<<<<<<<<<
 *                 b0 = <BpfInterface>(self.bpfpointers[self.numbpfs-1])
 *             return b0.__ccall__(x)
 */
      {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          #endif
          /*try:*/ {

            /* "bpf4/core.pyx":5123
 *         elif index >= self.numbpfs - 1:
 *             with gil:
 *                 b0 = <BpfInterface>(self.bpfpointers[self.numbpfs-1])             # <<<<<<<<<<<<<<
 *             return b0.__ccall__(x)
 *         else:
 */
            __pyx_t_3 = (__pyx_v_self->__pyx_base.bpfpointers[(__pyx_v_self->numbpfs - 1)]);
            __pyx_t_2 = ((PyObject *)__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __pyx_v_b0 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
            __pyx_t_2 = 0;
          }

          /* "bpf4/core.pyx":5122
 *             return b0.__ccall__(x)
 *         elif index >= self.numbpfs - 1:
 *             with gil:             # <<<<<<<<<<<<<<
 *                 b0 = <BpfInterface>(self.bpfpointers[self.numbpfs-1])
 *             return b0.__ccall__(x)
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_PyGILState_Release(__pyx_gilstate_save);
              #endif
              goto __pyx_L12;
            }
            __pyx_L12:;
          }
      }

      /* "bpf4/core.pyx":5124
 *             with gil:
 *                 b0 = <BpfInterface>(self.bpfpointers[self.numbpfs-1])
 *             return b0.__ccall__(x)             # <<<<<<<<<<<<<<
 *         else:
 *             x0 = floor(index)
 */
      __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_b0->__pyx_vtab)->__pyx___ccall__(__pyx_v_b0, __pyx_v_x);
      goto __pyx_L3_return;

      /* "bpf4/core.pyx":5121
 *                 b0 = <BpfInterface>(self.bpfpointers[0])
 *             return b0.__ccall__(x)
 *         elif index >= self.numbpfs - 1:             # <<<<<<<<<<<<<<
 *             with gil:
 *                 b0 = <BpfInterface>(self.bpfpointers[self.numbpfs-1])
 */
    }

    /* "bpf4/core.pyx":5126
 *             return b0.__ccall__(x)
 *         else:
 *             x0 = floor(index)             # <<<<<<<<<<<<<<
 *             if x0 == index:
 *                 with gil:
 */
    /*else*/ {
      __pyx_v_x0 = floor(__pyx_v_index);

      /* "bpf4/core.pyx":5127
 *         else:
 *             x0 = floor(index)
 *             if x0 == index:             # <<<<<<<<<<<<<<
 *                 with gil:
 *                     b0 = <BpfInterface>(self.bpfpointers[<int>x0])
 */
      __pyx_t_1 = ((__pyx_v_x0 == __pyx_v_index) != 0);
      if (__pyx_t_1) {

        /* "bpf4/core.pyx":5128
 *             x0 = floor(index)
 *             if x0 == index:
 *                 with gil:             # <<<<<<<<<<<<<<
 *                     b0 = <BpfInterface>(self.bpfpointers[<int>x0])
 *                     return b0.__ccall__(x)
 */
        {
            #ifdef WITH_THREAD
            PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
            #endif
            /*try:*/ {

              /* "bpf4/core.pyx":5129
 *             if x0 == index:
 *                 with gil:
 *                     b0 = <BpfInterface>(self.bpfpointers[<int>x0])             # <<<<<<<<<<<<<<
 *                     return b0.__ccall__(x)
 * 
 */
              __pyx_t_2 = ((PyObject *)(__pyx_v_self->__pyx_base.bpfpointers[((int)__pyx_v_x0)]));
              __Pyx_INCREF(__pyx_t_2);
              __pyx_v_b0 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
              __pyx_t_2 = 0;

              /* "bpf4/core.pyx":5130
 *                 with gil:
 *                     b0 = <BpfInterface>(self.bpfpointers[<int>x0])
 *                     return b0.__ccall__(x)             # <<<<<<<<<<<<<<
 * 
 *             with gil:
 */
              __pyx_r = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_b0->__pyx_vtab)->__pyx___ccall__(__pyx_v_b0, __pyx_v_x);
              goto __pyx_L14_return;
            }

            /* "bpf4/core.pyx":5128
 *             x0 = floor(index)
 *             if x0 == index:
 *                 with gil:             # <<<<<<<<<<<<<<
 *                     b0 = <BpfInterface>(self.bpfpointers[<int>x0])
 *                     return b0.__ccall__(x)
 */
            /*finally:*/ {
              __pyx_L14_return: {
                #ifdef WITH_THREAD
                __Pyx_PyGILState_Release(__pyx_gilstate_save);
                #endif
                goto __pyx_L3_return;
              }
            }
        }

        /* "bpf4/core.pyx":5127
 *         else:
 *             x0 = floor(index)
 *             if x0 == index:             # <<<<<<<<<<<<<<
 *                 with gil:
 *                     b0 = <BpfInterface>(self.bpfpointers[<int>x0])
 */
      }

      /* "bpf4/core.pyx":5132
 *                     return b0.__ccall__(x)
 * 
 *             with gil:             # <<<<<<<<<<<<<<
 *                 b0 = <BpfInterface>(self.bpfpointers[<int>x0])
 *                 b1 = <BpfInterface>(self.bpfpointers[<int>x0 + 1])
 */
      {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          #endif
          /*try:*/ {

            /* "bpf4/core.pyx":5133
 * 
 *             with gil:
 *                 b0 = <BpfInterface>(self.bpfpointers[<int>x0])             # <<<<<<<<<<<<<<
 *                 b1 = <BpfInterface>(self.bpfpointers[<int>x0 + 1])
 * 
 */
            __pyx_t_2 = ((PyObject *)(__pyx_v_self->__pyx_base.bpfpointers[((int)__pyx_v_x0)]));
            __Pyx_INCREF(__pyx_t_2);
            __pyx_v_b0 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
            __pyx_t_2 = 0;

            /* "bpf4/core.pyx":5134
 *             with gil:
 *                 b0 = <BpfInterface>(self.bpfpointers[<int>x0])
 *                 b1 = <BpfInterface>(self.bpfpointers[<int>x0 + 1])             # <<<<<<<<<<<<<<
 * 
 *             y0 = b0.__ccall__(x)
 */
            __pyx_t_3 = (__pyx_v_self->__pyx_base.bpfpointers[(((int)__pyx_v_x0) + 1)]);
            __pyx_t_2 = ((PyObject *)__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __pyx_v_b1 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_2);
            __pyx_t_2 = 0;
          }

          /* "bpf4/core.pyx":5132
 *                     return b0.__ccall__(x)
 * 
 *             with gil:             # <<<<<<<<<<<<<<
 *                 b0 = <BpfInterface>(self.bpfpointers[<int>x0])
 *                 b1 = <BpfInterface>(self.bpfpointers[<int>x0 + 1])
 */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_PyGILState_Release(__pyx_gilstate_save);
              #endif
              goto __pyx_L19;
            }
            __pyx_L19:;
          }
      }

      /* "bpf4/core.pyx":5136
 *                 b1 = <BpfInterface>(self.bpfpointers[<int>x0 + 1])
 * 
 *             y0 = b0.__ccall__(x)             # <<<<<<<<<<<<<<
 *             y1 = b1.__ccall__(x)
 *             return InterpolFunc_call(self.func, index, x0, y0, x0+1, y1)
 */
      __pyx_v_y0 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_b0->__pyx_vtab)->__pyx___ccall__(__pyx_v_b0, __pyx_v_x);

      /* "bpf4/core.pyx":5137
 * 
 *             y0 = b0.__ccall__(x)
 *             y1 = b1.__ccall__(x)             # <<<<<<<<<<<<<<
 *             return InterpolFunc_call(self.func, index, x0, y0, x0+1, y1)
 * 
 */
      __pyx_v_y1 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_b1->__pyx_vtab)->__pyx___ccall__(__pyx_v_b1, __pyx_v_x);

      /* "bpf4/core.pyx":5138
 *             y0 = b0.__ccall__(x)
 *             y1 = b1.__ccall__(x)
 *             return InterpolFunc_call(self.func, index, x0, y0, x0+1, y1)             # <<<<<<<<<<<<<<
 * 
 * def brentq(bpf, double x0, double xa, double xb, double xtol=9.9999999999999998e-13,
 */
      __pyx_r = __pyx_f_4bpf4_4core_InterpolFunc_call(__pyx_v_self->func, __pyx_v_index, __pyx_v_x0, __pyx_v_y0, (__pyx_v_x0 + 1.0), __pyx_v_y1);
      goto __pyx_L3_return;
    }
  }

  /* "bpf4/core.pyx":5115
 * 
 *     cdef double __ccall__(self, double x) nogil:
 *         cdef double index = self.which.__ccall__(x)             # <<<<<<<<<<<<<<
 *         cdef double y0, y1, x0
 *         if index <= 0:
 */
  /*finally:*/ {
    __pyx_L3_return: {
      #ifdef WITH_THREAD
      __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      #endif
      goto __pyx_L0;
    }
  }

  /* "bpf4/core.pyx":5114
 *         _MultipleBpfs.__init__(self, bpfs)
 * 
 *     cdef double __ccall__(self, double x) nogil:             # <<<<<<<<<<<<<<
 *         cdef double index = self.which.__ccall__(x)
 *         cdef double y0, y1, x0
 */

  /* function exit code */
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_b0);
  __Pyx_XDECREF((PyObject *)__pyx_v_b1);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "bpf4/core.pyx":5140
 *             return InterpolFunc_call(self.func, index, x0, y0, x0+1, y1)
 * 
 * def brentq(bpf, double x0, double xa, double xb, double xtol=9.9999999999999998e-13,             # <<<<<<<<<<<<<<
 *            double rtol=4.4408920985006262e-16, max_iter=100):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_11brentq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_10brentq[] = "brentq(bpf, double x0, double xa, double xb, double xtol=9.9999999999999998e-13, double rtol=4.4408920985006262e-16, max_iter=100)\n\n    calculate the zero of (bpf + x0) in the interval (xa, xb) using brentq algorithm\n\n    !!! note \n\n        To calculate all the zeros of a bpf, use the [.zeros](#zeros) method\n\n    Args:\n        bpf (BpfInterface): the bpf to evaluate\n        x0 (float): an offset so that bpf(x) + x0 = 0\n        xa (float): the starting point to look for a zero\n        xb (float): the end point\n        xtol (float): The computed root x0 will satisfy np.allclose(x, x0, atol=xtol, rtol=rtol)\n        rtol (float): The computed root x0 will satisfy np.allclose(x, x0, atol=xtol, rtol=rtol)\n        max_iter (int): the max. number of iterations\n\n    Returns:\n        (tuple[float, int]) A tuple (zero of the bpf, number of function calls)\n\n\n    ## Example\n    \n    ```python\n\n    # calculate the x where a == 0.5\n    >>> from bpf4 import *\n    >>> a = linear(0, 0, 10, 1)\n    >>> xzero, numcalls = brentq(a, -0.5, 0, 1)\n    >>> xzero\n    5\n    ```\n    ";
static PyMethodDef __pyx_mdef_4bpf4_4core_11brentq = {"brentq", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_11brentq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_10brentq};
static PyObject *__pyx_pw_4bpf4_4core_11brentq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_bpf = 0;
  double __pyx_v_x0;
  double __pyx_v_xa;
  double __pyx_v_xb;
  double __pyx_v_xtol;
  double __pyx_v_rtol;
  PyObject *__pyx_v_max_iter = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("brentq (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bpf,&__pyx_n_s_x0,&__pyx_n_s_xa,&__pyx_n_s_xb,&__pyx_n_s_xtol,&__pyx_n_s_rtol,&__pyx_n_s_max_iter,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[6] = ((PyObject *)((PyObject *)__pyx_int_100));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bpf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("brentq", 0, 4, 7, 1); __PYX_ERR(0, 5140, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xa)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("brentq", 0, 4, 7, 2); __PYX_ERR(0, 5140, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("brentq", 0, 4, 7, 3); __PYX_ERR(0, 5140, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xtol);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rtol);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_iter);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "brentq") < 0)) __PYX_ERR(0, 5140, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_bpf = values[0];
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5140, __pyx_L3_error)
    __pyx_v_xa = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xa == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5140, __pyx_L3_error)
    __pyx_v_xb = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_xb == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5140, __pyx_L3_error)
    if (values[4]) {
      __pyx_v_xtol = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_xtol == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5140, __pyx_L3_error)
    } else {
      __pyx_v_xtol = ((double)((double)9.9999999999999998e-13));
    }
    if (values[5]) {
      __pyx_v_rtol = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_rtol == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5141, __pyx_L3_error)
    } else {
      __pyx_v_rtol = ((double)((double)4.4408920985006262e-16));
    }
    __pyx_v_max_iter = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("brentq", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5140, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.brentq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_10brentq(__pyx_self, __pyx_v_bpf, __pyx_v_x0, __pyx_v_xa, __pyx_v_xb, __pyx_v_xtol, __pyx_v_rtol, __pyx_v_max_iter);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_10brentq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bpf, double __pyx_v_x0, double __pyx_v_xa, double __pyx_v_xb, double __pyx_v_xtol, double __pyx_v_rtol, PyObject *__pyx_v_max_iter) {
  int __pyx_v_outerror;
  int __pyx_v_funcalls;
  double __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("brentq", 0);

  /* "bpf4/core.pyx":5176
 *     cdef int outerror, funcalls
 *     cdef double result
 *     result = _bpf_brentq(bpf, x0, xa, xb, &outerror, xtol, rtol, max_iter, &funcalls)             # <<<<<<<<<<<<<<
 *     if outerror:
 *         raise ValueError("zero of function cannot be found within the interval given")
 */
  if (!(likely(((__pyx_v_bpf) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_bpf, __pyx_ptype_4bpf4_4core_BpfInterface))))) __PYX_ERR(0, 5176, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_max_iter); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5176, __pyx_L1_error)
  __pyx_v_result = __pyx_f_4bpf4_4core__bpf_brentq(((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_v_bpf), __pyx_v_x0, __pyx_v_xa, __pyx_v_xb, (&__pyx_v_outerror), __pyx_v_xtol, __pyx_v_rtol, __pyx_t_1, (&__pyx_v_funcalls));

  /* "bpf4/core.pyx":5177
 *     cdef double result
 *     result = _bpf_brentq(bpf, x0, xa, xb, &outerror, xtol, rtol, max_iter, &funcalls)
 *     if outerror:             # <<<<<<<<<<<<<<
 *         raise ValueError("zero of function cannot be found within the interval given")
 *     return result, funcalls
 */
  __pyx_t_2 = (__pyx_v_outerror != 0);
  if (unlikely(__pyx_t_2)) {

    /* "bpf4/core.pyx":5178
 *     result = _bpf_brentq(bpf, x0, xa, xb, &outerror, xtol, rtol, max_iter, &funcalls)
 *     if outerror:
 *         raise ValueError("zero of function cannot be found within the interval given")             # <<<<<<<<<<<<<<
 *     return result, funcalls
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 5178, __pyx_L1_error)

    /* "bpf4/core.pyx":5177
 *     cdef double result
 *     result = _bpf_brentq(bpf, x0, xa, xb, &outerror, xtol, rtol, max_iter, &funcalls)
 *     if outerror:             # <<<<<<<<<<<<<<
 *         raise ValueError("zero of function cannot be found within the interval given")
 *     return result, funcalls
 */
  }

  /* "bpf4/core.pyx":5179
 *     if outerror:
 *         raise ValueError("zero of function cannot be found within the interval given")
 *     return result, funcalls             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_funcalls); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":5140
 *             return InterpolFunc_call(self.func, index, x0, y0, x0+1, y1)
 * 
 * def brentq(bpf, double x0, double xa, double xb, double xtol=9.9999999999999998e-13,             # <<<<<<<<<<<<<<
 *            double rtol=4.4408920985006262e-16, max_iter=100):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bpf4.core.brentq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":5182
 * 
 * 
 * cpdef BpfInterface blend(a, b, mix=0.5):             # <<<<<<<<<<<<<<
 *     """
 *     Blend these BPFs
 */

static PyObject *__pyx_pw_4bpf4_4core_13blend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_f_4bpf4_4core_blend(PyObject *__pyx_v_a, PyObject *__pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_blend *__pyx_optional_args) {
  PyObject *__pyx_v_mix = ((PyObject *)__pyx_float_0_5);
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("blend", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_mix = __pyx_optional_args->mix;
    }
  }

  /* "bpf4/core.pyx":5229
 *     ![](assets/blend2.png)
 *     """
 *     if isinstance(mix, (int, float)):             # <<<<<<<<<<<<<<
 *         return _BpfBlendConst(_asbpf(a), _asbpf(b), mix)
 *     return _BpfBlend(_asbpf(a), _asbpf(b), _asbpf(mix))
 */
  __pyx_t_2 = PyInt_Check(__pyx_v_mix); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyFloat_Check(__pyx_v_mix); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bpf4/core.pyx":5230
 *     """
 *     if isinstance(mix, (int, float)):
 *         return _BpfBlendConst(_asbpf(a), _asbpf(b), mix)             # <<<<<<<<<<<<<<
 *     return _BpfBlend(_asbpf(a), _asbpf(b), _asbpf(mix))
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_4 = ((PyObject *)__pyx_f_4bpf4_4core__asbpf(__pyx_v_a)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = ((PyObject *)__pyx_f_4bpf4_4core__asbpf(__pyx_v_b)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_INCREF(__pyx_v_mix);
    __Pyx_GIVEREF(__pyx_v_mix);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_mix);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfBlendConst), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":5229
 *     ![](assets/blend2.png)
 *     """
 *     if isinstance(mix, (int, float)):             # <<<<<<<<<<<<<<
 *         return _BpfBlendConst(_asbpf(a), _asbpf(b), mix)
 *     return _BpfBlend(_asbpf(a), _asbpf(b), _asbpf(mix))
 */
  }

  /* "bpf4/core.pyx":5231
 *     if isinstance(mix, (int, float)):
 *         return _BpfBlendConst(_asbpf(a), _asbpf(b), mix)
 *     return _BpfBlend(_asbpf(a), _asbpf(b), _asbpf(mix))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_5 = ((PyObject *)__pyx_f_4bpf4_4core__asbpf(__pyx_v_a)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = ((PyObject *)__pyx_f_4bpf4_4core__asbpf(__pyx_v_b)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = ((PyObject *)__pyx_f_4bpf4_4core__asbpf(__pyx_v_mix)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4bpf4_4core__BpfBlend), __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "bpf4/core.pyx":5182
 * 
 * 
 * cpdef BpfInterface blend(a, b, mix=0.5):             # <<<<<<<<<<<<<<
 *     """
 *     Blend these BPFs
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bpf4.core.blend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_13blend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_12blend[] = "blend(a, b, mix=0.5) -> BpfInterface\n\n    Blend these BPFs\n\n    Args:\n        a (BpfInterface): first bpf\n        b (BpfInterface): second bpf\n        mix (float | BpfInterface): how to mix the bpfs. Can be fixed or\n            itself a bpf (or any function) returning a value between 0-1 \n\n    Returns:\n        (BpfInterface) The blended bpf\n    \n    \n    !!! note\n\n        if mix == 0: the result is *a*\n        if mix == 1: the result is *b*\n    \n    \n    ## Example\n    \n    Create a curve which is in between a halfcos and a linear interpolation\n    \n    ```python\n    from bpf4 import *\n    a = halfcos(0, 0, 1, 1, exp=2)\n    b = linear(0, 0, 1, 1)\n    c = blend(a, b, 0.5)\n\n    a.plot(show=False, color=\"red\")\n    b.plot(show=False, color=\"blue\")\n    c.plot(color=\"green\")\n\n    ```\n    ![](assets/blend1.png)\n\n    Closer to halfcos\n\n    ```python\n    c = blend(a, b, 0.2)\n    a.plot(show=False, color=\"red\")\n    b.plot(show=False, color=\"blue\")\n    c.plot(color=\"green\")\n    ```\n    ![](assets/blend2.png)\n    ";
static PyMethodDef __pyx_mdef_4bpf4_4core_13blend = {"blend", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_13blend, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12blend};
static PyObject *__pyx_pw_4bpf4_4core_13blend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_b = 0;
  PyObject *__pyx_v_mix = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("blend (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,&__pyx_n_s_mix,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)__pyx_float_0_5);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("blend", 0, 2, 3, 1); __PYX_ERR(0, 5182, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mix);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "blend") < 0)) __PYX_ERR(0, 5182, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_a = values[0];
    __pyx_v_b = values[1];
    __pyx_v_mix = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("blend", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5182, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.blend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4bpf4_4core_12blend(__pyx_self, __pyx_v_a, __pyx_v_b, __pyx_v_mix);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_12blend(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_mix) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_blend __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("blend", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.mix = __pyx_v_mix;
  __pyx_t_1 = ((PyObject *)__pyx_f_4bpf4_4core_blend(__pyx_v_a, __pyx_v_b, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.blend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":5235
 * 
 * 
 * cdef inline int isnumber(obj):             # <<<<<<<<<<<<<<
 *     return isinstance(obj, (int, float))
 * 
 */

static CYTHON_INLINE int __pyx_f_4bpf4_4core_isnumber(PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("isnumber", 0);

  /* "bpf4/core.pyx":5236
 * 
 * cdef inline int isnumber(obj):
 *     return isinstance(obj, (int, float))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyInt_Check(__pyx_v_obj); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = PyFloat_Check(__pyx_v_obj); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "bpf4/core.pyx":5235
 * 
 * 
 * cdef inline int isnumber(obj):             # <<<<<<<<<<<<<<
 *     return isinstance(obj, (int, float))
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":5240
 * 
 * @cython.cdivision(True)
 * cdef inline double _bpf_brentq(BpfInterface bpf, double x0, double xa, double xb, int* outerror,             # <<<<<<<<<<<<<<
 *                                double xtol, double rtol, int max_iter, int *outfuncalls) nogil:
 *     # original values: xtol=9.9999999999999998e-13, rtol=4.4408920985006262e-16, max_iter=100
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core__bpf_brentq(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_bpf, double __pyx_v_x0, double __pyx_v_xa, double __pyx_v_xb, int *__pyx_v_outerror, double __pyx_v_xtol, double __pyx_v_rtol, int __pyx_v_max_iter, int *__pyx_v_outfuncalls) {
  double __pyx_v_xpre;
  double __pyx_v_xcur;
  double __pyx_v_xblk;
  double __pyx_v_fpre;
  double __pyx_v_fcur;
  double __pyx_v_stry;
  double __pyx_v_dpre;
  double __pyx_v_dblk;
  double __pyx_v_sbis;
  double __pyx_v_tol;
  double __pyx_v_fblk;
  double __pyx_v_spre;
  double __pyx_v_scur;
  double __pyx_v_a;
  double __pyx_v_b;
  int __pyx_v_funcalls;
  CYTHON_UNUSED int __pyx_v_i;
  double __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  double __pyx_t_5;
  int __pyx_t_6;

  /* "bpf4/core.pyx":5246
 *     # if it is not possible, outerror is set to 1, otherwise it is 0
 *     cdef:
 *         double xpre = xa             # <<<<<<<<<<<<<<
 *         double xcur = xb
 *         double xblk = 0
 */
  __pyx_v_xpre = __pyx_v_xa;

  /* "bpf4/core.pyx":5247
 *     cdef:
 *         double xpre = xa
 *         double xcur = xb             # <<<<<<<<<<<<<<
 *         double xblk = 0
 *         double fpre, fcur, stry, dpre, dblk, sbis, tol
 */
  __pyx_v_xcur = __pyx_v_xb;

  /* "bpf4/core.pyx":5248
 *         double xpre = xa
 *         double xcur = xb
 *         double xblk = 0             # <<<<<<<<<<<<<<
 *         double fpre, fcur, stry, dpre, dblk, sbis, tol
 *         double fblk = 0
 */
  __pyx_v_xblk = 0.0;

  /* "bpf4/core.pyx":5250
 *         double xblk = 0
 *         double fpre, fcur, stry, dpre, dblk, sbis, tol
 *         double fblk = 0             # <<<<<<<<<<<<<<
 *         double spre = 0
 *         double scur = 0
 */
  __pyx_v_fblk = 0.0;

  /* "bpf4/core.pyx":5251
 *         double fpre, fcur, stry, dpre, dblk, sbis, tol
 *         double fblk = 0
 *         double spre = 0             # <<<<<<<<<<<<<<
 *         double scur = 0
 *         double a, b
 */
  __pyx_v_spre = 0.0;

  /* "bpf4/core.pyx":5252
 *         double fblk = 0
 *         double spre = 0
 *         double scur = 0             # <<<<<<<<<<<<<<
 *         double a, b
 *         int funcalls = 2
 */
  __pyx_v_scur = 0.0;

  /* "bpf4/core.pyx":5254
 *         double scur = 0
 *         double a, b
 *         int funcalls = 2             # <<<<<<<<<<<<<<
 *         int i
 *     outerror[0] = 0
 */
  __pyx_v_funcalls = 2;

  /* "bpf4/core.pyx":5256
 *         int funcalls = 2
 *         int i
 *     outerror[0] = 0             # <<<<<<<<<<<<<<
 *     fpre = bpf.__ccall__(xpre) + x0
 *     fcur = bpf.__ccall__(xcur) + x0
 */
  (__pyx_v_outerror[0]) = 0;

  /* "bpf4/core.pyx":5257
 *         int i
 *     outerror[0] = 0
 *     fpre = bpf.__ccall__(xpre) + x0             # <<<<<<<<<<<<<<
 *     fcur = bpf.__ccall__(xcur) + x0
 *     outfuncalls[0] = 2
 */
  __pyx_v_fpre = (((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_bpf, __pyx_v_xpre) + __pyx_v_x0);

  /* "bpf4/core.pyx":5258
 *     outerror[0] = 0
 *     fpre = bpf.__ccall__(xpre) + x0
 *     fcur = bpf.__ccall__(xcur) + x0             # <<<<<<<<<<<<<<
 *     outfuncalls[0] = 2
 *     if fpre * fcur > 0:
 */
  __pyx_v_fcur = (((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_bpf, __pyx_v_xcur) + __pyx_v_x0);

  /* "bpf4/core.pyx":5259
 *     fpre = bpf.__ccall__(xpre) + x0
 *     fcur = bpf.__ccall__(xcur) + x0
 *     outfuncalls[0] = 2             # <<<<<<<<<<<<<<
 *     if fpre * fcur > 0:
 *         outerror[0] = 1
 */
  (__pyx_v_outfuncalls[0]) = 2;

  /* "bpf4/core.pyx":5260
 *     fcur = bpf.__ccall__(xcur) + x0
 *     outfuncalls[0] = 2
 *     if fpre * fcur > 0:             # <<<<<<<<<<<<<<
 *         outerror[0] = 1
 *         return 0
 */
  __pyx_t_1 = (((__pyx_v_fpre * __pyx_v_fcur) > 0.0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":5261
 *     outfuncalls[0] = 2
 *     if fpre * fcur > 0:
 *         outerror[0] = 1             # <<<<<<<<<<<<<<
 *         return 0
 *     if fpre == 0:
 */
    (__pyx_v_outerror[0]) = 1;

    /* "bpf4/core.pyx":5262
 *     if fpre * fcur > 0:
 *         outerror[0] = 1
 *         return 0             # <<<<<<<<<<<<<<
 *     if fpre == 0:
 *         return xpre
 */
    __pyx_r = 0.0;
    goto __pyx_L0;

    /* "bpf4/core.pyx":5260
 *     fcur = bpf.__ccall__(xcur) + x0
 *     outfuncalls[0] = 2
 *     if fpre * fcur > 0:             # <<<<<<<<<<<<<<
 *         outerror[0] = 1
 *         return 0
 */
  }

  /* "bpf4/core.pyx":5263
 *         outerror[0] = 1
 *         return 0
 *     if fpre == 0:             # <<<<<<<<<<<<<<
 *         return xpre
 *     if fcur == 0:
 */
  __pyx_t_1 = ((__pyx_v_fpre == 0.0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":5264
 *         return 0
 *     if fpre == 0:
 *         return xpre             # <<<<<<<<<<<<<<
 *     if fcur == 0:
 *         return xcur
 */
    __pyx_r = __pyx_v_xpre;
    goto __pyx_L0;

    /* "bpf4/core.pyx":5263
 *         outerror[0] = 1
 *         return 0
 *     if fpre == 0:             # <<<<<<<<<<<<<<
 *         return xpre
 *     if fcur == 0:
 */
  }

  /* "bpf4/core.pyx":5265
 *     if fpre == 0:
 *         return xpre
 *     if fcur == 0:             # <<<<<<<<<<<<<<
 *         return xcur
 *     for i in range(max_iter):
 */
  __pyx_t_1 = ((__pyx_v_fcur == 0.0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":5266
 *         return xpre
 *     if fcur == 0:
 *         return xcur             # <<<<<<<<<<<<<<
 *     for i in range(max_iter):
 *         if fpre * fcur < 0:
 */
    __pyx_r = __pyx_v_xcur;
    goto __pyx_L0;

    /* "bpf4/core.pyx":5265
 *     if fpre == 0:
 *         return xpre
 *     if fcur == 0:             # <<<<<<<<<<<<<<
 *         return xcur
 *     for i in range(max_iter):
 */
  }

  /* "bpf4/core.pyx":5267
 *     if fcur == 0:
 *         return xcur
 *     for i in range(max_iter):             # <<<<<<<<<<<<<<
 *         if fpre * fcur < 0:
 *             xblk = xpre
 */
  __pyx_t_2 = __pyx_v_max_iter;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "bpf4/core.pyx":5268
 *         return xcur
 *     for i in range(max_iter):
 *         if fpre * fcur < 0:             # <<<<<<<<<<<<<<
 *             xblk = xpre
 *             fblk = fpre
 */
    __pyx_t_1 = (((__pyx_v_fpre * __pyx_v_fcur) < 0.0) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":5269
 *     for i in range(max_iter):
 *         if fpre * fcur < 0:
 *             xblk = xpre             # <<<<<<<<<<<<<<
 *             fblk = fpre
 *             spre = scur = xcur - xpre
 */
      __pyx_v_xblk = __pyx_v_xpre;

      /* "bpf4/core.pyx":5270
 *         if fpre * fcur < 0:
 *             xblk = xpre
 *             fblk = fpre             # <<<<<<<<<<<<<<
 *             spre = scur = xcur - xpre
 *         if fabs(fblk) < fabs(fcur):
 */
      __pyx_v_fblk = __pyx_v_fpre;

      /* "bpf4/core.pyx":5271
 *             xblk = xpre
 *             fblk = fpre
 *             spre = scur = xcur - xpre             # <<<<<<<<<<<<<<
 *         if fabs(fblk) < fabs(fcur):
 *             xpre = xcur
 */
      __pyx_t_5 = (__pyx_v_xcur - __pyx_v_xpre);
      __pyx_v_spre = __pyx_t_5;
      __pyx_v_scur = __pyx_t_5;

      /* "bpf4/core.pyx":5268
 *         return xcur
 *     for i in range(max_iter):
 *         if fpre * fcur < 0:             # <<<<<<<<<<<<<<
 *             xblk = xpre
 *             fblk = fpre
 */
    }

    /* "bpf4/core.pyx":5272
 *             fblk = fpre
 *             spre = scur = xcur - xpre
 *         if fabs(fblk) < fabs(fcur):             # <<<<<<<<<<<<<<
 *             xpre = xcur
 *             xcur = xblk
 */
    __pyx_t_1 = ((fabs(__pyx_v_fblk) < fabs(__pyx_v_fcur)) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":5273
 *             spre = scur = xcur - xpre
 *         if fabs(fblk) < fabs(fcur):
 *             xpre = xcur             # <<<<<<<<<<<<<<
 *             xcur = xblk
 *             xblk = xpre
 */
      __pyx_v_xpre = __pyx_v_xcur;

      /* "bpf4/core.pyx":5274
 *         if fabs(fblk) < fabs(fcur):
 *             xpre = xcur
 *             xcur = xblk             # <<<<<<<<<<<<<<
 *             xblk = xpre
 *             fpre = fcur
 */
      __pyx_v_xcur = __pyx_v_xblk;

      /* "bpf4/core.pyx":5275
 *             xpre = xcur
 *             xcur = xblk
 *             xblk = xpre             # <<<<<<<<<<<<<<
 *             fpre = fcur
 *             fcur = fblk
 */
      __pyx_v_xblk = __pyx_v_xpre;

      /* "bpf4/core.pyx":5276
 *             xcur = xblk
 *             xblk = xpre
 *             fpre = fcur             # <<<<<<<<<<<<<<
 *             fcur = fblk
 *             fblk = fpre
 */
      __pyx_v_fpre = __pyx_v_fcur;

      /* "bpf4/core.pyx":5277
 *             xblk = xpre
 *             fpre = fcur
 *             fcur = fblk             # <<<<<<<<<<<<<<
 *             fblk = fpre
 *         tol = xtol + rtol * fabs(xcur)
 */
      __pyx_v_fcur = __pyx_v_fblk;

      /* "bpf4/core.pyx":5278
 *             fpre = fcur
 *             fcur = fblk
 *             fblk = fpre             # <<<<<<<<<<<<<<
 *         tol = xtol + rtol * fabs(xcur)
 *         sbis = (xblk - xcur) / 2
 */
      __pyx_v_fblk = __pyx_v_fpre;

      /* "bpf4/core.pyx":5272
 *             fblk = fpre
 *             spre = scur = xcur - xpre
 *         if fabs(fblk) < fabs(fcur):             # <<<<<<<<<<<<<<
 *             xpre = xcur
 *             xcur = xblk
 */
    }

    /* "bpf4/core.pyx":5279
 *             fcur = fblk
 *             fblk = fpre
 *         tol = xtol + rtol * fabs(xcur)             # <<<<<<<<<<<<<<
 *         sbis = (xblk - xcur) / 2
 *         if fabs(fcur) == 0 or fabs(sbis) < tol:
 */
    __pyx_v_tol = (__pyx_v_xtol + (__pyx_v_rtol * fabs(__pyx_v_xcur)));

    /* "bpf4/core.pyx":5280
 *             fblk = fpre
 *         tol = xtol + rtol * fabs(xcur)
 *         sbis = (xblk - xcur) / 2             # <<<<<<<<<<<<<<
 *         if fabs(fcur) == 0 or fabs(sbis) < tol:
 *             return xcur
 */
    __pyx_v_sbis = ((__pyx_v_xblk - __pyx_v_xcur) / 2.0);

    /* "bpf4/core.pyx":5281
 *         tol = xtol + rtol * fabs(xcur)
 *         sbis = (xblk - xcur) / 2
 *         if fabs(fcur) == 0 or fabs(sbis) < tol:             # <<<<<<<<<<<<<<
 *             return xcur
 *         if fabs(spre) > tol and fabs(fcur) < fabs(fpre):
 */
    __pyx_t_6 = ((fabs(__pyx_v_fcur) == 0.0) != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_1 = __pyx_t_6;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_6 = ((fabs(__pyx_v_sbis) < __pyx_v_tol) != 0);
    __pyx_t_1 = __pyx_t_6;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":5282
 *         sbis = (xblk - xcur) / 2
 *         if fabs(fcur) == 0 or fabs(sbis) < tol:
 *             return xcur             # <<<<<<<<<<<<<<
 *         if fabs(spre) > tol and fabs(fcur) < fabs(fpre):
 *             if xpre == xblk:    # interpolate
 */
      __pyx_r = __pyx_v_xcur;
      goto __pyx_L0;

      /* "bpf4/core.pyx":5281
 *         tol = xtol + rtol * fabs(xcur)
 *         sbis = (xblk - xcur) / 2
 *         if fabs(fcur) == 0 or fabs(sbis) < tol:             # <<<<<<<<<<<<<<
 *             return xcur
 *         if fabs(spre) > tol and fabs(fcur) < fabs(fpre):
 */
    }

    /* "bpf4/core.pyx":5283
 *         if fabs(fcur) == 0 or fabs(sbis) < tol:
 *             return xcur
 *         if fabs(spre) > tol and fabs(fcur) < fabs(fpre):             # <<<<<<<<<<<<<<
 *             if xpre == xblk:    # interpolate
 *                 stry = -fcur * (xcur - xpre) / (fcur - fpre)
 */
    __pyx_t_6 = ((fabs(__pyx_v_spre) > __pyx_v_tol) != 0);
    if (__pyx_t_6) {
    } else {
      __pyx_t_1 = __pyx_t_6;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_6 = ((fabs(__pyx_v_fcur) < fabs(__pyx_v_fpre)) != 0);
    __pyx_t_1 = __pyx_t_6;
    __pyx_L14_bool_binop_done:;
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":5284
 *             return xcur
 *         if fabs(spre) > tol and fabs(fcur) < fabs(fpre):
 *             if xpre == xblk:    # interpolate             # <<<<<<<<<<<<<<
 *                 stry = -fcur * (xcur - xpre) / (fcur - fpre)
 *             else:               # extrapolate
 */
      __pyx_t_1 = ((__pyx_v_xpre == __pyx_v_xblk) != 0);
      if (__pyx_t_1) {

        /* "bpf4/core.pyx":5285
 *         if fabs(spre) > tol and fabs(fcur) < fabs(fpre):
 *             if xpre == xblk:    # interpolate
 *                 stry = -fcur * (xcur - xpre) / (fcur - fpre)             # <<<<<<<<<<<<<<
 *             else:               # extrapolate
 *                 dpre = (fpre - fcur)/(xpre - xcur)
 */
        __pyx_v_stry = (((-__pyx_v_fcur) * (__pyx_v_xcur - __pyx_v_xpre)) / (__pyx_v_fcur - __pyx_v_fpre));

        /* "bpf4/core.pyx":5284
 *             return xcur
 *         if fabs(spre) > tol and fabs(fcur) < fabs(fpre):
 *             if xpre == xblk:    # interpolate             # <<<<<<<<<<<<<<
 *                 stry = -fcur * (xcur - xpre) / (fcur - fpre)
 *             else:               # extrapolate
 */
        goto __pyx_L16;
      }

      /* "bpf4/core.pyx":5287
 *                 stry = -fcur * (xcur - xpre) / (fcur - fpre)
 *             else:               # extrapolate
 *                 dpre = (fpre - fcur)/(xpre - xcur)             # <<<<<<<<<<<<<<
 *                 dblk = (fblk - fcur)/(xblk - xcur)
 *                 stry = -fcur*(fblk*dblk - fpre*dpre) / (dblk*dpre*(fblk - fpre))
 */
      /*else*/ {
        __pyx_v_dpre = ((__pyx_v_fpre - __pyx_v_fcur) / (__pyx_v_xpre - __pyx_v_xcur));

        /* "bpf4/core.pyx":5288
 *             else:               # extrapolate
 *                 dpre = (fpre - fcur)/(xpre - xcur)
 *                 dblk = (fblk - fcur)/(xblk - xcur)             # <<<<<<<<<<<<<<
 *                 stry = -fcur*(fblk*dblk - fpre*dpre) / (dblk*dpre*(fblk - fpre))
 *             # if (2*fabs(stry) < DMIN(fabs(spre), 3*fabs(sbis) - tol)):
 */
        __pyx_v_dblk = ((__pyx_v_fblk - __pyx_v_fcur) / (__pyx_v_xblk - __pyx_v_xcur));

        /* "bpf4/core.pyx":5289
 *                 dpre = (fpre - fcur)/(xpre - xcur)
 *                 dblk = (fblk - fcur)/(xblk - xcur)
 *                 stry = -fcur*(fblk*dblk - fpre*dpre) / (dblk*dpre*(fblk - fpre))             # <<<<<<<<<<<<<<
 *             # if (2*fabs(stry) < DMIN(fabs(spre), 3*fabs(sbis) - tol)):
 *             a = fabs(spre)
 */
        __pyx_v_stry = (((-__pyx_v_fcur) * ((__pyx_v_fblk * __pyx_v_dblk) - (__pyx_v_fpre * __pyx_v_dpre))) / ((__pyx_v_dblk * __pyx_v_dpre) * (__pyx_v_fblk - __pyx_v_fpre)));
      }
      __pyx_L16:;

      /* "bpf4/core.pyx":5291
 *                 stry = -fcur*(fblk*dblk - fpre*dpre) / (dblk*dpre*(fblk - fpre))
 *             # if (2*fabs(stry) < DMIN(fabs(spre), 3*fabs(sbis) - tol)):
 *             a = fabs(spre)             # <<<<<<<<<<<<<<
 *             b = 3*fabs(sbis) - tol
 *             if (2*fabs(stry) < (a if a < b else b)):
 */
      __pyx_v_a = fabs(__pyx_v_spre);

      /* "bpf4/core.pyx":5292
 *             # if (2*fabs(stry) < DMIN(fabs(spre), 3*fabs(sbis) - tol)):
 *             a = fabs(spre)
 *             b = 3*fabs(sbis) - tol             # <<<<<<<<<<<<<<
 *             if (2*fabs(stry) < (a if a < b else b)):
 *             #if (2*fabs(stry) < DMIN(fabs(spre), 3*fabs(sbis) - tol)):
 */
      __pyx_v_b = ((3.0 * fabs(__pyx_v_sbis)) - __pyx_v_tol);

      /* "bpf4/core.pyx":5293
 *             a = fabs(spre)
 *             b = 3*fabs(sbis) - tol
 *             if (2*fabs(stry) < (a if a < b else b)):             # <<<<<<<<<<<<<<
 *             #if (2*fabs(stry) < DMIN(fabs(spre), 3*fabs(sbis) - tol)):
 *                 spre = scur
 */
      if (((__pyx_v_a < __pyx_v_b) != 0)) {
        __pyx_t_5 = __pyx_v_a;
      } else {
        __pyx_t_5 = __pyx_v_b;
      }
      __pyx_t_1 = (((2.0 * fabs(__pyx_v_stry)) < __pyx_t_5) != 0);
      if (__pyx_t_1) {

        /* "bpf4/core.pyx":5295
 *             if (2*fabs(stry) < (a if a < b else b)):
 *             #if (2*fabs(stry) < DMIN(fabs(spre), 3*fabs(sbis) - tol)):
 *                 spre = scur             # <<<<<<<<<<<<<<
 *                 scur = stry  # good short step
 *             else:
 */
        __pyx_v_spre = __pyx_v_scur;

        /* "bpf4/core.pyx":5296
 *             #if (2*fabs(stry) < DMIN(fabs(spre), 3*fabs(sbis) - tol)):
 *                 spre = scur
 *                 scur = stry  # good short step             # <<<<<<<<<<<<<<
 *             else:
 *                 spre = sbis
 */
        __pyx_v_scur = __pyx_v_stry;

        /* "bpf4/core.pyx":5293
 *             a = fabs(spre)
 *             b = 3*fabs(sbis) - tol
 *             if (2*fabs(stry) < (a if a < b else b)):             # <<<<<<<<<<<<<<
 *             #if (2*fabs(stry) < DMIN(fabs(spre), 3*fabs(sbis) - tol)):
 *                 spre = scur
 */
        goto __pyx_L17;
      }

      /* "bpf4/core.pyx":5298
 *                 scur = stry  # good short step
 *             else:
 *                 spre = sbis             # <<<<<<<<<<<<<<
 *                 scur = sbis  # bisect
 *         else:
 */
      /*else*/ {
        __pyx_v_spre = __pyx_v_sbis;

        /* "bpf4/core.pyx":5299
 *             else:
 *                 spre = sbis
 *                 scur = sbis  # bisect             # <<<<<<<<<<<<<<
 *         else:
 *             spre = sbis
 */
        __pyx_v_scur = __pyx_v_sbis;
      }
      __pyx_L17:;

      /* "bpf4/core.pyx":5283
 *         if fabs(fcur) == 0 or fabs(sbis) < tol:
 *             return xcur
 *         if fabs(spre) > tol and fabs(fcur) < fabs(fpre):             # <<<<<<<<<<<<<<
 *             if xpre == xblk:    # interpolate
 *                 stry = -fcur * (xcur - xpre) / (fcur - fpre)
 */
      goto __pyx_L13;
    }

    /* "bpf4/core.pyx":5301
 *                 scur = sbis  # bisect
 *         else:
 *             spre = sbis             # <<<<<<<<<<<<<<
 *             scur = sbis
 *         xpre = xcur
 */
    /*else*/ {
      __pyx_v_spre = __pyx_v_sbis;

      /* "bpf4/core.pyx":5302
 *         else:
 *             spre = sbis
 *             scur = sbis             # <<<<<<<<<<<<<<
 *         xpre = xcur
 *         fpre = fcur
 */
      __pyx_v_scur = __pyx_v_sbis;
    }
    __pyx_L13:;

    /* "bpf4/core.pyx":5303
 *             spre = sbis
 *             scur = sbis
 *         xpre = xcur             # <<<<<<<<<<<<<<
 *         fpre = fcur
 *         if fabs(scur) > tol:
 */
    __pyx_v_xpre = __pyx_v_xcur;

    /* "bpf4/core.pyx":5304
 *             scur = sbis
 *         xpre = xcur
 *         fpre = fcur             # <<<<<<<<<<<<<<
 *         if fabs(scur) > tol:
 *             xcur += scur
 */
    __pyx_v_fpre = __pyx_v_fcur;

    /* "bpf4/core.pyx":5305
 *         xpre = xcur
 *         fpre = fcur
 *         if fabs(scur) > tol:             # <<<<<<<<<<<<<<
 *             xcur += scur
 *         else:
 */
    __pyx_t_1 = ((fabs(__pyx_v_scur) > __pyx_v_tol) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":5306
 *         fpre = fcur
 *         if fabs(scur) > tol:
 *             xcur += scur             # <<<<<<<<<<<<<<
 *         else:
 *             xcur += tol if sbis > 0 else -tol
 */
      __pyx_v_xcur = (__pyx_v_xcur + __pyx_v_scur);

      /* "bpf4/core.pyx":5305
 *         xpre = xcur
 *         fpre = fcur
 *         if fabs(scur) > tol:             # <<<<<<<<<<<<<<
 *             xcur += scur
 *         else:
 */
      goto __pyx_L18;
    }

    /* "bpf4/core.pyx":5308
 *             xcur += scur
 *         else:
 *             xcur += tol if sbis > 0 else -tol             # <<<<<<<<<<<<<<
 *         fcur = bpf.__ccall__(xcur) + x0
 *         funcalls += 1
 */
    /*else*/ {
      if (((__pyx_v_sbis > 0.0) != 0)) {
        __pyx_t_5 = __pyx_v_tol;
      } else {
        __pyx_t_5 = (-__pyx_v_tol);
      }
      __pyx_v_xcur = (__pyx_v_xcur + __pyx_t_5);
    }
    __pyx_L18:;

    /* "bpf4/core.pyx":5309
 *         else:
 *             xcur += tol if sbis > 0 else -tol
 *         fcur = bpf.__ccall__(xcur) + x0             # <<<<<<<<<<<<<<
 *         funcalls += 1
 *     outfuncalls[0] = funcalls
 */
    __pyx_v_fcur = (((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_bpf->__pyx_vtab)->__pyx___ccall__(__pyx_v_bpf, __pyx_v_xcur) + __pyx_v_x0);

    /* "bpf4/core.pyx":5310
 *             xcur += tol if sbis > 0 else -tol
 *         fcur = bpf.__ccall__(xcur) + x0
 *         funcalls += 1             # <<<<<<<<<<<<<<
 *     outfuncalls[0] = funcalls
 *     return xcur
 */
    __pyx_v_funcalls = (__pyx_v_funcalls + 1);
  }

  /* "bpf4/core.pyx":5311
 *         fcur = bpf.__ccall__(xcur) + x0
 *         funcalls += 1
 *     outfuncalls[0] = funcalls             # <<<<<<<<<<<<<<
 *     return xcur
 * 
 */
  (__pyx_v_outfuncalls[0]) = __pyx_v_funcalls;

  /* "bpf4/core.pyx":5312
 *         funcalls += 1
 *     outfuncalls[0] = funcalls
 *     return xcur             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __pyx_r = __pyx_v_xcur;
  goto __pyx_L0;

  /* "bpf4/core.pyx":5240
 * 
 * @cython.cdivision(True)
 * cdef inline double _bpf_brentq(BpfInterface bpf, double x0, double xa, double xb, int* outerror,             # <<<<<<<<<<<<<<
 *                                double xtol, double rtol, int max_iter, int *outfuncalls) nogil:
 *     # original values: xtol=9.9999999999999998e-13, rtol=4.4408920985006262e-16, max_iter=100
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "bpf4/core.pyx":5316
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cpdef list bpf_zero_crossings(BpfInterface b, double h=0.01, int N=0,             # <<<<<<<<<<<<<<
 *                               double x0=NAN, double x1=NAN, int maxzeros=0):
 *     """
 */

static PyObject *__pyx_pw_4bpf4_4core_15bpf_zero_crossings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_4bpf4_4core_bpf_zero_crossings(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_bpf_zero_crossings *__pyx_optional_args) {
  double __pyx_v_h = ((double)0.01);
  int __pyx_v_N = ((int)0);
  double __pyx_v_x0 = __pyx_k__36;
  double __pyx_v_x1 = __pyx_k__37;
  int __pyx_v_maxzeros = ((int)0);
  PyObject *__pyx_v_out = 0;
  double __pyx_v_y0;
  double __pyx_v_y1;
  double __pyx_v_xa;
  double __pyx_v_xb;
  double __pyx_v_zero;
  int __pyx_v_outerror;
  int __pyx_v_funcalls;
  double __pyx_v_last_zero;
  int __pyx_v_numzeros;
  int __pyx_v_add_it;
  long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  double __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  long __pyx_t_5;
  long __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bpf_zero_crossings", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_h = __pyx_optional_args->h;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_N = __pyx_optional_args->N;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_x0 = __pyx_optional_args->x0;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_x1 = __pyx_optional_args->x1;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_maxzeros = __pyx_optional_args->maxzeros;
            }
          }
        }
      }
    }
  }

  /* "bpf4/core.pyx":5333
 *         (List[float]) A list of zeros (x coord points where the bpf is 0)
 *     """
 *     if isnan(x0):             # <<<<<<<<<<<<<<
 *         x0 = b._x0
 *     if isnan(x1):
 */
  __pyx_t_1 = (isnan(__pyx_v_x0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":5334
 *     """
 *     if isnan(x0):
 *         x0 = b._x0             # <<<<<<<<<<<<<<
 *     if isnan(x1):
 *         x1 = b._x1
 */
    __pyx_t_2 = __pyx_v_b->_x0;
    __pyx_v_x0 = __pyx_t_2;

    /* "bpf4/core.pyx":5333
 *         (List[float]) A list of zeros (x coord points where the bpf is 0)
 *     """
 *     if isnan(x0):             # <<<<<<<<<<<<<<
 *         x0 = b._x0
 *     if isnan(x1):
 */
  }

  /* "bpf4/core.pyx":5335
 *     if isnan(x0):
 *         x0 = b._x0
 *     if isnan(x1):             # <<<<<<<<<<<<<<
 *         x1 = b._x1
 *     if h > (x1 - x0) * 0.5:
 */
  __pyx_t_1 = (isnan(__pyx_v_x1) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":5336
 *         x0 = b._x0
 *     if isnan(x1):
 *         x1 = b._x1             # <<<<<<<<<<<<<<
 *     if h > (x1 - x0) * 0.5:
 *         h = (x1 - x0) * 0.25
 */
    __pyx_t_2 = __pyx_v_b->_x1;
    __pyx_v_x1 = __pyx_t_2;

    /* "bpf4/core.pyx":5335
 *     if isnan(x0):
 *         x0 = b._x0
 *     if isnan(x1):             # <<<<<<<<<<<<<<
 *         x1 = b._x1
 *     if h > (x1 - x0) * 0.5:
 */
  }

  /* "bpf4/core.pyx":5337
 *     if isnan(x1):
 *         x1 = b._x1
 *     if h > (x1 - x0) * 0.5:             # <<<<<<<<<<<<<<
 *         h = (x1 - x0) * 0.25
 *     if N == 0:
 */
  __pyx_t_1 = ((__pyx_v_h > ((__pyx_v_x1 - __pyx_v_x0) * 0.5)) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":5338
 *         x1 = b._x1
 *     if h > (x1 - x0) * 0.5:
 *         h = (x1 - x0) * 0.25             # <<<<<<<<<<<<<<
 *     if N == 0:
 *         N = <int>((x1 - x0) / h) + 1
 */
    __pyx_v_h = ((__pyx_v_x1 - __pyx_v_x0) * 0.25);

    /* "bpf4/core.pyx":5337
 *     if isnan(x1):
 *         x1 = b._x1
 *     if h > (x1 - x0) * 0.5:             # <<<<<<<<<<<<<<
 *         h = (x1 - x0) * 0.25
 *     if N == 0:
 */
  }

  /* "bpf4/core.pyx":5339
 *     if h > (x1 - x0) * 0.5:
 *         h = (x1 - x0) * 0.25
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         N = <int>((x1 - x0) / h) + 1
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_N == 0) != 0);
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":5340
 *         h = (x1 - x0) * 0.25
 *     if N == 0:
 *         N = <int>((x1 - x0) / h) + 1             # <<<<<<<<<<<<<<
 *     else:
 *         h = (x1 - x0) / (N - 1)
 */
    __pyx_v_N = (((int)((__pyx_v_x1 - __pyx_v_x0) / __pyx_v_h)) + 1);

    /* "bpf4/core.pyx":5339
 *     if h > (x1 - x0) * 0.5:
 *         h = (x1 - x0) * 0.25
 *     if N == 0:             # <<<<<<<<<<<<<<
 *         N = <int>((x1 - x0) / h) + 1
 *     else:
 */
    goto __pyx_L6;
  }

  /* "bpf4/core.pyx":5342
 *         N = <int>((x1 - x0) / h) + 1
 *     else:
 *         h = (x1 - x0) / (N - 1)             # <<<<<<<<<<<<<<
 *     cdef list out = []
 *     cdef double y0, y1, xa, xb, zero
 */
  /*else*/ {
    __pyx_v_h = ((__pyx_v_x1 - __pyx_v_x0) / ((double)(__pyx_v_N - 1)));
  }
  __pyx_L6:;

  /* "bpf4/core.pyx":5343
 *     else:
 *         h = (x1 - x0) / (N - 1)
 *     cdef list out = []             # <<<<<<<<<<<<<<
 *     cdef double y0, y1, xa, xb, zero
 *     cdef int outerror, funcalls
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_out = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "bpf4/core.pyx":5346
 *     cdef double y0, y1, xa, xb, zero
 *     cdef int outerror, funcalls
 *     y1 = b.__ccall__(x0)             # <<<<<<<<<<<<<<
 *     cdef double last_zero = 0
 *     cdef int numzeros = 0
 */
  __pyx_v_y1 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_b->__pyx_vtab)->__pyx___ccall__(__pyx_v_b, __pyx_v_x0);

  /* "bpf4/core.pyx":5347
 *     cdef int outerror, funcalls
 *     y1 = b.__ccall__(x0)
 *     cdef double last_zero = 0             # <<<<<<<<<<<<<<
 *     cdef int numzeros = 0
 *     cdef int add_it
 */
  __pyx_v_last_zero = 0.0;

  /* "bpf4/core.pyx":5348
 *     y1 = b.__ccall__(x0)
 *     cdef double last_zero = 0
 *     cdef int numzeros = 0             # <<<<<<<<<<<<<<
 *     cdef int add_it
 *     for i in range(N - 1):
 */
  __pyx_v_numzeros = 0;

  /* "bpf4/core.pyx":5350
 *     cdef int numzeros = 0
 *     cdef int add_it
 *     for i in range(N - 1):             # <<<<<<<<<<<<<<
 *         xa = x0 + i * h
 *         xb = xa + h - EPS
 */
  __pyx_t_4 = (__pyx_v_N - 1);
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "bpf4/core.pyx":5351
 *     cdef int add_it
 *     for i in range(N - 1):
 *         xa = x0 + i * h             # <<<<<<<<<<<<<<
 *         xb = xa + h - EPS
 *         y0 = b.__ccall__(xa)
 */
    __pyx_v_xa = (__pyx_v_x0 + (__pyx_v_i * __pyx_v_h));

    /* "bpf4/core.pyx":5352
 *     for i in range(N - 1):
 *         xa = x0 + i * h
 *         xb = xa + h - EPS             # <<<<<<<<<<<<<<
 *         y0 = b.__ccall__(xa)
 *         y1 = b.__ccall__(xb)
 */
    __pyx_v_xb = ((__pyx_v_xa + __pyx_v_h) - __pyx_v_4bpf4_4core_EPS);

    /* "bpf4/core.pyx":5353
 *         xa = x0 + i * h
 *         xb = xa + h - EPS
 *         y0 = b.__ccall__(xa)             # <<<<<<<<<<<<<<
 *         y1 = b.__ccall__(xb)
 *         add_it = 0
 */
    __pyx_v_y0 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_b->__pyx_vtab)->__pyx___ccall__(__pyx_v_b, __pyx_v_xa);

    /* "bpf4/core.pyx":5354
 *         xb = xa + h - EPS
 *         y0 = b.__ccall__(xa)
 *         y1 = b.__ccall__(xb)             # <<<<<<<<<<<<<<
 *         add_it = 0
 *         # print(xa, xb, y0, y1)
 */
    __pyx_v_y1 = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_b->__pyx_vtab)->__pyx___ccall__(__pyx_v_b, __pyx_v_xb);

    /* "bpf4/core.pyx":5355
 *         y0 = b.__ccall__(xa)
 *         y1 = b.__ccall__(xb)
 *         add_it = 0             # <<<<<<<<<<<<<<
 *         # print(xa, xb, y0, y1)
 *         if y0 * y1 < 0:
 */
    __pyx_v_add_it = 0;

    /* "bpf4/core.pyx":5357
 *         add_it = 0
 *         # print(xa, xb, y0, y1)
 *         if y0 * y1 < 0:             # <<<<<<<<<<<<<<
 *             # print("y0*y1")
 *             outerror = -1
 */
    __pyx_t_1 = (((__pyx_v_y0 * __pyx_v_y1) < 0.0) != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":5359
 *         if y0 * y1 < 0:
 *             # print("y0*y1")
 *             outerror = -1             # <<<<<<<<<<<<<<
 *             zero = _bpf_brentq(b, 0, xa, xb, &outerror, 9.9999999999999998e-13, 4.4408920985006262e-16, 100, &funcalls)
 *             if outerror == 0:
 */
      __pyx_v_outerror = -1;

      /* "bpf4/core.pyx":5360
 *             # print("y0*y1")
 *             outerror = -1
 *             zero = _bpf_brentq(b, 0, xa, xb, &outerror, 9.9999999999999998e-13, 4.4408920985006262e-16, 100, &funcalls)             # <<<<<<<<<<<<<<
 *             if outerror == 0:
 *                 add_it = 1
 */
      __pyx_v_zero = __pyx_f_4bpf4_4core__bpf_brentq(__pyx_v_b, 0.0, __pyx_v_xa, __pyx_v_xb, (&__pyx_v_outerror), 9.9999999999999998e-13, 4.4408920985006262e-16, 0x64, (&__pyx_v_funcalls));

      /* "bpf4/core.pyx":5361
 *             outerror = -1
 *             zero = _bpf_brentq(b, 0, xa, xb, &outerror, 9.9999999999999998e-13, 4.4408920985006262e-16, 100, &funcalls)
 *             if outerror == 0:             # <<<<<<<<<<<<<<
 *                 add_it = 1
 *         elif y1 == 0 and y0 != 0:
 */
      __pyx_t_1 = ((__pyx_v_outerror == 0) != 0);
      if (__pyx_t_1) {

        /* "bpf4/core.pyx":5362
 *             zero = _bpf_brentq(b, 0, xa, xb, &outerror, 9.9999999999999998e-13, 4.4408920985006262e-16, 100, &funcalls)
 *             if outerror == 0:
 *                 add_it = 1             # <<<<<<<<<<<<<<
 *         elif y1 == 0 and y0 != 0:
 *             zero = xb
 */
        __pyx_v_add_it = 1;

        /* "bpf4/core.pyx":5361
 *             outerror = -1
 *             zero = _bpf_brentq(b, 0, xa, xb, &outerror, 9.9999999999999998e-13, 4.4408920985006262e-16, 100, &funcalls)
 *             if outerror == 0:             # <<<<<<<<<<<<<<
 *                 add_it = 1
 *         elif y1 == 0 and y0 != 0:
 */
      }

      /* "bpf4/core.pyx":5357
 *         add_it = 0
 *         # print(xa, xb, y0, y1)
 *         if y0 * y1 < 0:             # <<<<<<<<<<<<<<
 *             # print("y0*y1")
 *             outerror = -1
 */
      goto __pyx_L9;
    }

    /* "bpf4/core.pyx":5363
 *             if outerror == 0:
 *                 add_it = 1
 *         elif y1 == 0 and y0 != 0:             # <<<<<<<<<<<<<<
 *             zero = xb
 *             add_it = 1
 */
    __pyx_t_7 = ((__pyx_v_y1 == 0.0) != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_1 = __pyx_t_7;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_7 = ((__pyx_v_y0 != 0.0) != 0);
    __pyx_t_1 = __pyx_t_7;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":5364
 *                 add_it = 1
 *         elif y1 == 0 and y0 != 0:
 *             zero = xb             # <<<<<<<<<<<<<<
 *             add_it = 1
 *         elif y0 == 0 and y1 != 0 and xa > last_zero:
 */
      __pyx_v_zero = __pyx_v_xb;

      /* "bpf4/core.pyx":5365
 *         elif y1 == 0 and y0 != 0:
 *             zero = xb
 *             add_it = 1             # <<<<<<<<<<<<<<
 *         elif y0 == 0 and y1 != 0 and xa > last_zero:
 *             zero = xa
 */
      __pyx_v_add_it = 1;

      /* "bpf4/core.pyx":5363
 *             if outerror == 0:
 *                 add_it = 1
 *         elif y1 == 0 and y0 != 0:             # <<<<<<<<<<<<<<
 *             zero = xb
 *             add_it = 1
 */
      goto __pyx_L9;
    }

    /* "bpf4/core.pyx":5366
 *             zero = xb
 *             add_it = 1
 *         elif y0 == 0 and y1 != 0 and xa > last_zero:             # <<<<<<<<<<<<<<
 *             zero = xa
 *             add_it = 1
 */
    __pyx_t_7 = ((__pyx_v_y0 == 0.0) != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_1 = __pyx_t_7;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_7 = ((__pyx_v_y1 != 0.0) != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_1 = __pyx_t_7;
      goto __pyx_L13_bool_binop_done;
    }
    __pyx_t_7 = ((__pyx_v_xa > __pyx_v_last_zero) != 0);
    __pyx_t_1 = __pyx_t_7;
    __pyx_L13_bool_binop_done:;
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":5367
 *             add_it = 1
 *         elif y0 == 0 and y1 != 0 and xa > last_zero:
 *             zero = xa             # <<<<<<<<<<<<<<
 *             add_it = 1
 *         if add_it:
 */
      __pyx_v_zero = __pyx_v_xa;

      /* "bpf4/core.pyx":5368
 *         elif y0 == 0 and y1 != 0 and xa > last_zero:
 *             zero = xa
 *             add_it = 1             # <<<<<<<<<<<<<<
 *         if add_it:
 *             last_zero = zero
 */
      __pyx_v_add_it = 1;

      /* "bpf4/core.pyx":5366
 *             zero = xb
 *             add_it = 1
 *         elif y0 == 0 and y1 != 0 and xa > last_zero:             # <<<<<<<<<<<<<<
 *             zero = xa
 *             add_it = 1
 */
    }
    __pyx_L9:;

    /* "bpf4/core.pyx":5369
 *             zero = xa
 *             add_it = 1
 *         if add_it:             # <<<<<<<<<<<<<<
 *             last_zero = zero
 *             out.append(zero)
 */
    __pyx_t_1 = (__pyx_v_add_it != 0);
    if (__pyx_t_1) {

      /* "bpf4/core.pyx":5370
 *             add_it = 1
 *         if add_it:
 *             last_zero = zero             # <<<<<<<<<<<<<<
 *             out.append(zero)
 *             numzeros += 1
 */
      __pyx_v_last_zero = __pyx_v_zero;

      /* "bpf4/core.pyx":5371
 *         if add_it:
 *             last_zero = zero
 *             out.append(zero)             # <<<<<<<<<<<<<<
 *             numzeros += 1
 *             if maxzeros > 0 and numzeros >= maxzeros:
 */
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_zero); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_out, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 5371, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "bpf4/core.pyx":5372
 *             last_zero = zero
 *             out.append(zero)
 *             numzeros += 1             # <<<<<<<<<<<<<<
 *             if maxzeros > 0 and numzeros >= maxzeros:
 *                 break
 */
      __pyx_v_numzeros = (__pyx_v_numzeros + 1);

      /* "bpf4/core.pyx":5373
 *             out.append(zero)
 *             numzeros += 1
 *             if maxzeros > 0 and numzeros >= maxzeros:             # <<<<<<<<<<<<<<
 *                 break
 *     return out
 */
      __pyx_t_7 = ((__pyx_v_maxzeros > 0) != 0);
      if (__pyx_t_7) {
      } else {
        __pyx_t_1 = __pyx_t_7;
        goto __pyx_L18_bool_binop_done;
      }
      __pyx_t_7 = ((__pyx_v_numzeros >= __pyx_v_maxzeros) != 0);
      __pyx_t_1 = __pyx_t_7;
      __pyx_L18_bool_binop_done:;
      if (__pyx_t_1) {

        /* "bpf4/core.pyx":5374
 *             numzeros += 1
 *             if maxzeros > 0 and numzeros >= maxzeros:
 *                 break             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
        goto __pyx_L8_break;

        /* "bpf4/core.pyx":5373
 *             out.append(zero)
 *             numzeros += 1
 *             if maxzeros > 0 and numzeros >= maxzeros:             # <<<<<<<<<<<<<<
 *                 break
 *     return out
 */
      }

      /* "bpf4/core.pyx":5369
 *             zero = xa
 *             add_it = 1
 *         if add_it:             # <<<<<<<<<<<<<<
 *             last_zero = zero
 *             out.append(zero)
 */
    }
  }
  __pyx_L8_break:;

  /* "bpf4/core.pyx":5375
 *             if maxzeros > 0 and numzeros >= maxzeros:
 *                 break
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bpf4/core.pyx":5316
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cpdef list bpf_zero_crossings(BpfInterface b, double h=0.01, int N=0,             # <<<<<<<<<<<<<<
 *                               double x0=NAN, double x1=NAN, int maxzeros=0):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bpf4.core.bpf_zero_crossings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_4bpf4_4core_15bpf_zero_crossings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4bpf4_4core_14bpf_zero_crossings[] = "bpf_zero_crossings(BpfInterface b, double h=0.01, int N=0, double x0=NAN, double x1=NAN, int maxzeros=0) -> list\n\n    Return the zeros if b in the interval defined\n\n    Args:\n        b (BpfInterface): a bpf\n        h (float): the interval to scan for zeros. for each interval only one zero will be found\n        N (int): alternatively you can give the number of intervals to scan. *h* will be calculated \n            from *N* (the *h* parameter is not used)\n        x0 (float): If given, the bounds to search within \n        x1 (float): If given, the bounds to search within\n        maxzeros: if given, search will stop if this number of zeros is found\n\n    Returns:\n        (List[float]) A list of zeros (x coord points where the bpf is 0)\n    ";
static PyMethodDef __pyx_mdef_4bpf4_4core_15bpf_zero_crossings = {"bpf_zero_crossings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_15bpf_zero_crossings, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_14bpf_zero_crossings};
static PyObject *__pyx_pw_4bpf4_4core_15bpf_zero_crossings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b = 0;
  double __pyx_v_h;
  int __pyx_v_N;
  double __pyx_v_x0;
  double __pyx_v_x1;
  int __pyx_v_maxzeros;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bpf_zero_crossings (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_h,&__pyx_n_s_N,&__pyx_n_s_x0,&__pyx_n_s_x1,&__pyx_n_s_maxzeros,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxzeros);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bpf_zero_crossings") < 0)) __PYX_ERR(0, 5316, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)values[0]);
    if (values[1]) {
      __pyx_v_h = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_h == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5316, __pyx_L3_error)
    } else {
      __pyx_v_h = ((double)0.01);
    }
    if (values[2]) {
      __pyx_v_N = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5316, __pyx_L3_error)
    } else {
      __pyx_v_N = ((int)0);
    }
    if (values[3]) {
      __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_x0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5317, __pyx_L3_error)
    } else {
      __pyx_v_x0 = __pyx_k__36;
    }
    if (values[4]) {
      __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5317, __pyx_L3_error)
    } else {
      __pyx_v_x1 = __pyx_k__37;
    }
    if (values[5]) {
      __pyx_v_maxzeros = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_maxzeros == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5317, __pyx_L3_error)
    } else {
      __pyx_v_maxzeros = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bpf_zero_crossings", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5316, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bpf4.core.bpf_zero_crossings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_4bpf4_4core_BpfInterface, 1, "b", 0))) __PYX_ERR(0, 5316, __pyx_L1_error)
  __pyx_r = __pyx_pf_4bpf4_4core_14bpf_zero_crossings(__pyx_self, __pyx_v_b, __pyx_v_h, __pyx_v_N, __pyx_v_x0, __pyx_v_x1, __pyx_v_maxzeros);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_4bpf4_4core_14bpf_zero_crossings(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_b, double __pyx_v_h, int __pyx_v_N, double __pyx_v_x0, double __pyx_v_x1, int __pyx_v_maxzeros) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_4bpf4_4core_bpf_zero_crossings __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bpf_zero_crossings", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 5;
  __pyx_t_2.h = __pyx_v_h;
  __pyx_t_2.N = __pyx_v_N;
  __pyx_t_2.x0 = __pyx_v_x0;
  __pyx_t_2.x1 = __pyx_v_x1;
  __pyx_t_2.maxzeros = __pyx_v_maxzeros;
  __pyx_t_1 = __pyx_f_4bpf4_4core_bpf_zero_crossings(__pyx_v_b, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bpf4.core.bpf_zero_crossings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":5378
 * 
 * 
 * cdef inline double _integrate_adaptive_simpsons_inner(BpfInterface f, double a, double b, double epsilon,             # <<<<<<<<<<<<<<
 *                                                       double S, double fa, double fb, double fc, int bottom):
 *     cdef:
 */

static CYTHON_INLINE double __pyx_f_4bpf4_4core__integrate_adaptive_simpsons_inner(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_f, double __pyx_v_a, double __pyx_v_b, double __pyx_v_epsilon, double __pyx_v_S, double __pyx_v_fa, double __pyx_v_fb, double __pyx_v_fc, int __pyx_v_bottom) {
  double __pyx_v_c;
  double __pyx_v_h;
  double __pyx_v_d;
  double __pyx_v_g;
  double __pyx_v_fd;
  double __pyx_v_fe;
  double __pyx_v_Sleft;
  double __pyx_v_Sright;
  double __pyx_v_S2;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_integrate_adaptive_simpsons_inner", 0);

  /* "bpf4/core.pyx":5381
 *                                                       double S, double fa, double fb, double fc, int bottom):
 *     cdef:
 *         double c = (a + b) / 2             # <<<<<<<<<<<<<<
 *         double h = b - a
 *         double d = (a + c) / 2
 */
  __pyx_v_c = ((__pyx_v_a + __pyx_v_b) / 2.0);

  /* "bpf4/core.pyx":5382
 *     cdef:
 *         double c = (a + b) / 2
 *         double h = b - a             # <<<<<<<<<<<<<<
 *         double d = (a + c) / 2
 *         double g = (c + b) / 2
 */
  __pyx_v_h = (__pyx_v_b - __pyx_v_a);

  /* "bpf4/core.pyx":5383
 *         double c = (a + b) / 2
 *         double h = b - a
 *         double d = (a + c) / 2             # <<<<<<<<<<<<<<
 *         double g = (c + b) / 2
 *         double fd = f.__ccall__(d)
 */
  __pyx_v_d = ((__pyx_v_a + __pyx_v_c) / 2.0);

  /* "bpf4/core.pyx":5384
 *         double h = b - a
 *         double d = (a + c) / 2
 *         double g = (c + b) / 2             # <<<<<<<<<<<<<<
 *         double fd = f.__ccall__(d)
 *         double fe = f.__ccall__(g)
 */
  __pyx_v_g = ((__pyx_v_c + __pyx_v_b) / 2.0);

  /* "bpf4/core.pyx":5385
 *         double d = (a + c) / 2
 *         double g = (c + b) / 2
 *         double fd = f.__ccall__(d)             # <<<<<<<<<<<<<<
 *         double fe = f.__ccall__(g)
 *         double Sleft = (h / 12) * (fa + 4 * fd + fc)
 */
  __pyx_v_fd = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_f->__pyx_vtab)->__pyx___ccall__(__pyx_v_f, __pyx_v_d);

  /* "bpf4/core.pyx":5386
 *         double g = (c + b) / 2
 *         double fd = f.__ccall__(d)
 *         double fe = f.__ccall__(g)             # <<<<<<<<<<<<<<
 *         double Sleft = (h / 12) * (fa + 4 * fd + fc)
 *         double Sright = (h / 12) * (fc + 4 * fe + fb)
 */
  __pyx_v_fe = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_f->__pyx_vtab)->__pyx___ccall__(__pyx_v_f, __pyx_v_g);

  /* "bpf4/core.pyx":5387
 *         double fd = f.__ccall__(d)
 *         double fe = f.__ccall__(g)
 *         double Sleft = (h / 12) * (fa + 4 * fd + fc)             # <<<<<<<<<<<<<<
 *         double Sright = (h / 12) * (fc + 4 * fe + fb)
 *     S2 = Sleft + Sright
 */
  __pyx_v_Sleft = ((__pyx_v_h / 12.0) * ((__pyx_v_fa + (4.0 * __pyx_v_fd)) + __pyx_v_fc));

  /* "bpf4/core.pyx":5388
 *         double fe = f.__ccall__(g)
 *         double Sleft = (h / 12) * (fa + 4 * fd + fc)
 *         double Sright = (h / 12) * (fc + 4 * fe + fb)             # <<<<<<<<<<<<<<
 *     S2 = Sleft + Sright
 *     if bottom <= 0 or abs(S2 - S) <= 15 * epsilon:
 */
  __pyx_v_Sright = ((__pyx_v_h / 12.0) * ((__pyx_v_fc + (4.0 * __pyx_v_fe)) + __pyx_v_fb));

  /* "bpf4/core.pyx":5389
 *         double Sleft = (h / 12) * (fa + 4 * fd + fc)
 *         double Sright = (h / 12) * (fc + 4 * fe + fb)
 *     S2 = Sleft + Sright             # <<<<<<<<<<<<<<
 *     if bottom <= 0 or abs(S2 - S) <= 15 * epsilon:
 *         return S2 + (S2 - S) / 15.
 */
  __pyx_v_S2 = (__pyx_v_Sleft + __pyx_v_Sright);

  /* "bpf4/core.pyx":5390
 *         double Sright = (h / 12) * (fc + 4 * fe + fb)
 *     S2 = Sleft + Sright
 *     if bottom <= 0 or abs(S2 - S) <= 15 * epsilon:             # <<<<<<<<<<<<<<
 *         return S2 + (S2 - S) / 15.
 *     return _integrate_adaptive_simpsons_inner(f, a, c, epsilon / 2, Sleft, fa, fc, fd, bottom - 1) + \
 */
  __pyx_t_2 = ((__pyx_v_bottom <= 0) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((fabs((__pyx_v_S2 - __pyx_v_S)) <= (15.0 * __pyx_v_epsilon)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "bpf4/core.pyx":5391
 *     S2 = Sleft + Sright
 *     if bottom <= 0 or abs(S2 - S) <= 15 * epsilon:
 *         return S2 + (S2 - S) / 15.             # <<<<<<<<<<<<<<
 *     return _integrate_adaptive_simpsons_inner(f, a, c, epsilon / 2, Sleft, fa, fc, fd, bottom - 1) + \
 *            _integrate_adaptive_simpsons_inner(f, c, b, epsilon / 2, Sright, fc, fb, fe, bottom - 1)
 */
    __pyx_r = (__pyx_v_S2 + ((__pyx_v_S2 - __pyx_v_S) / 15.));
    goto __pyx_L0;

    /* "bpf4/core.pyx":5390
 *         double Sright = (h / 12) * (fc + 4 * fe + fb)
 *     S2 = Sleft + Sright
 *     if bottom <= 0 or abs(S2 - S) <= 15 * epsilon:             # <<<<<<<<<<<<<<
 *         return S2 + (S2 - S) / 15.
 *     return _integrate_adaptive_simpsons_inner(f, a, c, epsilon / 2, Sleft, fa, fc, fd, bottom - 1) + \
 */
  }

  /* "bpf4/core.pyx":5392
 *     if bottom <= 0 or abs(S2 - S) <= 15 * epsilon:
 *         return S2 + (S2 - S) / 15.
 *     return _integrate_adaptive_simpsons_inner(f, a, c, epsilon / 2, Sleft, fa, fc, fd, bottom - 1) + \             # <<<<<<<<<<<<<<
 *            _integrate_adaptive_simpsons_inner(f, c, b, epsilon / 2, Sright, fc, fb, fe, bottom - 1)
 * 
 */
  __pyx_r = (__pyx_f_4bpf4_4core__integrate_adaptive_simpsons_inner(__pyx_v_f, __pyx_v_a, __pyx_v_c, (__pyx_v_epsilon / 2.0), __pyx_v_Sleft, __pyx_v_fa, __pyx_v_fc, __pyx_v_fd, (__pyx_v_bottom - 1)) + __pyx_f_4bpf4_4core__integrate_adaptive_simpsons_inner(__pyx_v_f, __pyx_v_c, __pyx_v_b, (__pyx_v_epsilon / 2.0), __pyx_v_Sright, __pyx_v_fc, __pyx_v_fb, __pyx_v_fe, (__pyx_v_bottom - 1)));
  goto __pyx_L0;

  /* "bpf4/core.pyx":5378
 * 
 * 
 * cdef inline double _integrate_adaptive_simpsons_inner(BpfInterface f, double a, double b, double epsilon,             # <<<<<<<<<<<<<<
 *                                                       double S, double fa, double fb, double fc, int bottom):
 *     cdef:
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bpf4/core.pyx":5395
 *            _integrate_adaptive_simpsons_inner(f, c, b, epsilon / 2, Sright, fc, fb, fe, bottom - 1)
 * 
 * cdef double integrate_simpsons(BpfInterface f, double a, double b, double accuracy=10e-10, int max_iterations=50):             # <<<<<<<<<<<<<<
 *     cdef:
 *         double c = (a + b) / 2
 */

static double __pyx_f_4bpf4_4core_integrate_simpsons(struct __pyx_obj_4bpf4_4core_BpfInterface *__pyx_v_f, double __pyx_v_a, double __pyx_v_b, struct __pyx_opt_args_4bpf4_4core_integrate_simpsons *__pyx_optional_args) {
  double __pyx_v_accuracy = ((double)10e-10);
  int __pyx_v_max_iterations = ((int)50);
  double __pyx_v_c;
  double __pyx_v_h;
  double __pyx_v_fa;
  double __pyx_v_fb;
  double __pyx_v_fc;
  double __pyx_v_S;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("integrate_simpsons", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_accuracy = __pyx_optional_args->accuracy;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_max_iterations = __pyx_optional_args->max_iterations;
      }
    }
  }

  /* "bpf4/core.pyx":5397
 * cdef double integrate_simpsons(BpfInterface f, double a, double b, double accuracy=10e-10, int max_iterations=50):
 *     cdef:
 *         double c = (a + b) / 2             # <<<<<<<<<<<<<<
 *         double h = b - a
 *         double fa = f.__ccall__(a)
 */
  __pyx_v_c = ((__pyx_v_a + __pyx_v_b) / 2.0);

  /* "bpf4/core.pyx":5398
 *     cdef:
 *         double c = (a + b) / 2
 *         double h = b - a             # <<<<<<<<<<<<<<
 *         double fa = f.__ccall__(a)
 *         double fb = f.__ccall__(b)
 */
  __pyx_v_h = (__pyx_v_b - __pyx_v_a);

  /* "bpf4/core.pyx":5399
 *         double c = (a + b) / 2
 *         double h = b - a
 *         double fa = f.__ccall__(a)             # <<<<<<<<<<<<<<
 *         double fb = f.__ccall__(b)
 *         double fc = f.__ccall__(c)
 */
  __pyx_v_fa = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_f->__pyx_vtab)->__pyx___ccall__(__pyx_v_f, __pyx_v_a);

  /* "bpf4/core.pyx":5400
 *         double h = b - a
 *         double fa = f.__ccall__(a)
 *         double fb = f.__ccall__(b)             # <<<<<<<<<<<<<<
 *         double fc = f.__ccall__(c)
 *         double S = (h / 6) * (fa + 4 * fc + fb)
 */
  __pyx_v_fb = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_f->__pyx_vtab)->__pyx___ccall__(__pyx_v_f, __pyx_v_b);

  /* "bpf4/core.pyx":5401
 *         double fa = f.__ccall__(a)
 *         double fb = f.__ccall__(b)
 *         double fc = f.__ccall__(c)             # <<<<<<<<<<<<<<
 *         double S = (h / 6) * (fa + 4 * fc + fb)
 *     return _integrate_adaptive_simpsons_inner(f, a, b, accuracy, S, fa, fb, fc, max_iterations)
 */
  __pyx_v_fc = ((struct __pyx_vtabstruct_4bpf4_4core_BpfInterface *)__pyx_v_f->__pyx_vtab)->__pyx___ccall__(__pyx_v_f, __pyx_v_c);

  /* "bpf4/core.pyx":5402
 *         double fb = f.__ccall__(b)
 *         double fc = f.__ccall__(c)
 *         double S = (h / 6) * (fa + 4 * fc + fb)             # <<<<<<<<<<<<<<
 *     return _integrate_adaptive_simpsons_inner(f, a, b, accuracy, S, fa, fb, fc, max_iterations)
 */
  __pyx_v_S = ((__pyx_v_h / 6.0) * ((__pyx_v_fa + (4.0 * __pyx_v_fc)) + __pyx_v_fb));

  /* "bpf4/core.pyx":5403
 *         double fc = f.__ccall__(c)
 *         double S = (h / 6) * (fa + 4 * fc + fb)
 *     return _integrate_adaptive_simpsons_inner(f, a, b, accuracy, S, fa, fb, fc, max_iterations)             # <<<<<<<<<<<<<<
 */
  __pyx_r = __pyx_f_4bpf4_4core__integrate_adaptive_simpsons_inner(__pyx_v_f, __pyx_v_a, __pyx_v_b, __pyx_v_accuracy, __pyx_v_S, __pyx_v_fa, __pyx_v_fb, __pyx_v_fc, __pyx_v_max_iterations);
  goto __pyx_L0;

  /* "bpf4/core.pyx":5395
 *            _integrate_adaptive_simpsons_inner(f, c, b, epsilon / 2, Sright, fc, fb, fe, bottom - 1)
 * 
 * cdef double integrate_simpsons(BpfInterface f, double a, double b, double accuracy=10e-10, int max_iterations=50):             # <<<<<<<<<<<<<<
 *     cdef:
 *         double c = (a + b) / 2
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":735
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":736
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":735
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":738
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":739
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":738
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":741
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":742
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":741
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":744
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":745
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":744
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":747
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":748
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":747
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":750
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":751
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
  if (__pyx_t_1) {

    /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":752
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
 *     else:
 *         return ()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
    __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
    goto __pyx_L0;

    /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":751
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  }

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":754
 *         return <tuple>d.subarray.shape
 *     else:
 *         return ()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_empty_tuple);
    __pyx_r = __pyx_empty_tuple;
    goto __pyx_L0;
  }

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":750
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":929
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":930
 * 
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
 *     PyArray_SetBaseObject(arr, base)
 * 
 */
  Py_INCREF(__pyx_v_base);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":931
 * cdef inline void set_array_base(ndarray arr, object base):
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":929
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":933
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_base;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":934
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
 *     if base is NULL:
 *         return None
 */
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":935
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
  if (__pyx_t_1) {

    /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":936
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     return <object>base
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":935
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  }

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":937
 *     if base is NULL:
 *         return None
 *     return <object>base             # <<<<<<<<<<<<<<
 * 
 * # Versions of the import_* functions which are more suitable for
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_base));
  __pyx_r = ((PyObject *)__pyx_v_base);
  goto __pyx_L0;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":933
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":941
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_array", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":942
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":943
 * cdef inline int import_array() except -1:
 *     try:
 *         __pyx_import_array()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")
 */
      __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)

      /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":942
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":944
 *     try:
 *         __pyx_import_array()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":945
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(1, 945, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":942
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":941
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":947
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_umath", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":948
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":949
 * cdef inline int import_umath() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)

      /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":948
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":950
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":951
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(1, 951, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":948
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":947
 *         raise ImportError("numpy.core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":953
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_ufunc", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":954
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":955
 * cdef inline int import_ufunc() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)

      /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":954
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":956
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":957
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef extern from *:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(1, 957, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":954
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":953
 *         raise ImportError("numpy.core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":967
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
 */

static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":979
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
  goto __pyx_L0;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":967
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":982
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
 */

static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_datetime64_object", 0);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":994
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
  goto __pyx_L0;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":982
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":997
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
 */

static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
  npy_datetime __pyx_r;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":1004
 *     also needed.  That can be found using `get_datetime64_unit`.
 *     """
 *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":997
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":1007
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
 */

static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
  npy_timedelta __pyx_r;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":1011
 *     returns the int64 value underlying scalar numpy timedelta64 object
 *     """
 *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":1007
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":1014
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
 */

static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
  NPY_DATETIMEUNIT __pyx_r;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":1018
 *     returns the unit part of the dtype for a numpy datetime64 object.
 *     """
 *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
 */
  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
  goto __pyx_L0;

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":1014
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_double____double____nogil_to_py")
 * cdef object __Pyx_CFunc_double____double____nogil_to_py(double (*f)(double) except *):
 *     def wrap(double x):             # <<<<<<<<<<<<<<
 *         """wrap(x: float) -> float"""
 *         return f(x)
 */

/* Python wrapper */
static PyObject *__pyx_pw_11cfunc_dot_to_py_43__Pyx_CFunc_double____double____nogil_to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_arg_x); /*proto*/
static char __pyx_doc_11cfunc_dot_to_py_43__Pyx_CFunc_double____double____nogil_to_py_wrap[] = "wrap(x: float) -> float";
static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_43__Pyx_CFunc_double____double____nogil_to_py_1wrap = {"wrap", (PyCFunction)__pyx_pw_11cfunc_dot_to_py_43__Pyx_CFunc_double____double____nogil_to_py_1wrap, METH_O, __pyx_doc_11cfunc_dot_to_py_43__Pyx_CFunc_double____double____nogil_to_py_wrap};
static PyObject *__pyx_pw_11cfunc_dot_to_py_43__Pyx_CFunc_double____double____nogil_to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_arg_x) {
  double __pyx_v_x;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wrap (wrapper)", 0);
  assert(__pyx_arg_x); {
    __pyx_v_x = __pyx_PyFloat_AsDouble(__pyx_arg_x); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 65, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_double____double____nogil_to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_11cfunc_dot_to_py_43__Pyx_CFunc_double____double____nogil_to_py_wrap(__pyx_self, ((double)__pyx_v_x));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_11cfunc_dot_to_py_43__Pyx_CFunc_double____double____nogil_to_py_wrap(PyObject *__pyx_self, double __pyx_v_x) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py *__pyx_cur_scope;
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);
  __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cfunc.to_py":67
 *     def wrap(double x):
 *         """wrap(x: float) -> float"""
 *         return f(x)             # <<<<<<<<<<<<<<
 *     return wrap
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_x); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(2, 67, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_double____double____nogil_to_py")
 * cdef object __Pyx_CFunc_double____double____nogil_to_py(double (*f)(double) except *):
 *     def wrap(double x):             # <<<<<<<<<<<<<<
 *         """wrap(x: float) -> float"""
 *         return f(x)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_double____double____nogil_to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_double____double____nogil_to_py")
 * cdef object __Pyx_CFunc_double____double____nogil_to_py(double (*f)(double) except *):             # <<<<<<<<<<<<<<
 *     def wrap(double x):
 *         """wrap(x: float) -> float"""
 */

static PyObject *__Pyx_CFunc_double____double____nogil_to_py(double (*__pyx_v_f)(double)) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py *__pyx_cur_scope;
  PyObject *__pyx_v_wrap = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_CFunc_double____double____nogil_to_py", 0);
  __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(2, 64, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_f = __pyx_v_f;

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_double____double____nogil_to_py")
 * cdef object __Pyx_CFunc_double____double____nogil_to_py(double (*f)(double) except *):
 *     def wrap(double x):             # <<<<<<<<<<<<<<
 *         """wrap(x: float) -> float"""
 *         return f(x)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_43__Pyx_CFunc_double____double____nogil_to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_double____double, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_wrap = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cfunc.to_py":68
 *         """wrap(x: float) -> float"""
 *         return f(x)
 *     return wrap             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_wrap);
  __pyx_r = __pyx_v_wrap;
  goto __pyx_L0;

  /* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_double____double____nogil_to_py")
 * cdef object __Pyx_CFunc_double____double____nogil_to_py(double (*f)(double) except *):             # <<<<<<<<<<<<<<
 *     def wrap(double x):
 *         """wrap(x: float) -> float"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_double____double____nogil_to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wrap);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":122
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
 */

/* Python wrapper */
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_shape = 0;
  Py_ssize_t __pyx_v_itemsize;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_mode = 0;
  int __pyx_v_allocate_buffer;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_n_s_c);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_shape = ((PyObject*)values[0]);
    __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error)
    __pyx_v_format = values[2];
    __pyx_v_mode = values[3];
    if (values[4]) {
      __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
    } else {

      /* "View.MemoryView":123
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
 *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
 * 
 *         cdef int idx
 */
      __pyx_v_allocate_buffer = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 122, __pyx_L1_error)
  }
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);

  /* "View.MemoryView":122
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_dim;
  PyObject **__pyx_v_p;
  char __pyx_v_order;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_format);

  /* "View.MemoryView":129
 *         cdef PyObject **p
 * 
 *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
 *         self.itemsize = itemsize
 * 
 */
  if (unlikely(__pyx_v_shape == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 129, __pyx_L1_error)
  }
  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error)
  __pyx_v_self->ndim = ((int)__pyx_t_1);

  /* "View.MemoryView":130
 * 
 *         self.ndim = <int> len(shape)
 *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not self.ndim:
 */
  __pyx_v_self->itemsize = __pyx_v_itemsize;

  /* "View.MemoryView":132
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError("Empty shape tuple for cython.array")
 * 
 */
  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "View.MemoryView":133
 * 
 *         if not self.ndim:
 *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if itemsize <= 0:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 133, __pyx_L1_error)

    /* "View.MemoryView":132
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError("Empty shape tuple for cython.array")
 * 
 */
  }

  /* "View.MemoryView":135
 *             raise ValueError("Empty shape tuple for cython.array")
 * 
 *         if itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("itemsize <= 0 for cython.array")
 * 
 */
  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "View.MemoryView":136
 * 
 *         if itemsize <= 0:
 *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(format, bytes):
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 136, __pyx_L1_error)

    /* "View.MemoryView":135
 *             raise ValueError("Empty shape tuple for cython.array")
 * 
 *         if itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("itemsize <= 0 for cython.array")
 * 
 */
  }

  /* "View.MemoryView":138
 *             raise ValueError("itemsize <= 0 for cython.array")
 * 
 *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 */
  __pyx_t_2 = PyBytes_Check(__pyx_v_format); 
  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_4) {

    /* "View.MemoryView":139
 * 
 *         if not isinstance(format, bytes):
 *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":138
 *             raise ValueError("itemsize <= 0 for cython.array")
 * 
 *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 */
  }

  /* "View.MemoryView":140
 *         if not isinstance(format, bytes):
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
 *         self.format = self._format
 * 
 */
  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 140, __pyx_L1_error)
  __pyx_t_3 = __pyx_v_format;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->_format);
  __Pyx_DECREF(__pyx_v_self->_format);
  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "View.MemoryView":141
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(__pyx_v_self->_format == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(2, 141, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error)
  __pyx_v_self->format = __pyx_t_7;

  /* "View.MemoryView":144
 * 
 * 
 *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
 *         self._strides = self._shape + self.ndim
 * 
 */
  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));

  /* "View.MemoryView":145
 * 
 *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
 *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
 * 
 *         if not self._shape:
 */
  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);

  /* "View.MemoryView":147
 *         self._strides = self._shape + self.ndim
 * 
 *         if not self._shape:             # <<<<<<<<<<<<<<
 *             raise MemoryError("unable to allocate shape and strides.")
 * 
 */
  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "View.MemoryView":148
 * 
 *         if not self._shape:
 *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 148, __pyx_L1_error)

    /* "View.MemoryView":147
 *         self._strides = self._shape + self.ndim
 * 
 *         if not self._shape:             # <<<<<<<<<<<<<<
 *             raise MemoryError("unable to allocate shape and strides.")
 * 
 */
  }

  /* "View.MemoryView":151
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 */
  __pyx_t_8 = 0;
  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 151, __pyx_L1_error)
    #else
    __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_dim = __pyx_t_9;
    __pyx_v_idx = __pyx_t_8;
    __pyx_t_8 = (__pyx_t_8 + 1);

    /* "View.MemoryView":152
 * 
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 *             self._shape[idx] = dim
 */
    __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "View.MemoryView":153
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
 *             self._shape[idx] = dim
 * 
 */
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_Raise(__pyx_t_10, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __PYX_ERR(2, 153, __pyx_L1_error)

      /* "View.MemoryView":152
 * 
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 *             self._shape[idx] = dim
 */
    }

    /* "View.MemoryView":154
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
 * 
 *         cdef char order
 */
    (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;

    /* "View.MemoryView":151
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "View.MemoryView":157
 * 
 *         cdef char order
 *         if mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "View.MemoryView":158
 *         cdef char order
 *         if mode == 'fortran':
 *             order = b'F'             # <<<<<<<<<<<<<<
 *             self.mode = u'fortran'
 *         elif mode == 'c':
 */
    __pyx_v_order = 'F';

    /* "View.MemoryView":159
 *         if mode == 'fortran':
 *             order = b'F'
 *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
 *         elif mode == 'c':
 *             order = b'C'
 */
    __Pyx_INCREF(__pyx_n_u_fortran);
    __Pyx_GIVEREF(__pyx_n_u_fortran);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_n_u_fortran;

    /* "View.MemoryView":157
 * 
 *         cdef char order
 *         if mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
 */
    goto __pyx_L10;
  }

  /* "View.MemoryView":160
 *             order = b'F'
 *             self.mode = u'fortran'
 *         elif mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error)
  if (likely(__pyx_t_4)) {

    /* "View.MemoryView":161
 *             self.mode = u'fortran'
 *         elif mode == 'c':
 *             order = b'C'             # <<<<<<<<<<<<<<
 *             self.mode = u'c'
 *         else:
 */
    __pyx_v_order = 'C';

    /* "View.MemoryView":162
 *         elif mode == 'c':
 *             order = b'C'
 *             self.mode = u'c'             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
 */
    __Pyx_INCREF(__pyx_n_u_c);
    __Pyx_GIVEREF(__pyx_n_u_c);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_n_u_c;

    /* "View.MemoryView":160
 *             order = b'F'
 *             self.mode = u'fortran'
 *         elif mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
 */
    goto __pyx_L10;
  }

  /* "View.MemoryView":164
 *             self.mode = u'c'
 *         else:
 *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides,
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_10, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __PYX_ERR(2, 164, __pyx_L1_error)
  }
  __pyx_L10:;

  /* "View.MemoryView":166
 *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
 *                                              itemsize, self.ndim, order)
 * 
 */
  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);

  /* "View.MemoryView":169
 *                                              itemsize, self.ndim, order)
 * 
 *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
 *         self.dtype_is_object = format == b'O'
 *         if allocate_buffer:
 */
  __pyx_v_self->free_data = __pyx_v_allocate_buffer;

  /* "View.MemoryView":170
 * 
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
 *         if allocate_buffer:
 * 
 */
  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_self->dtype_is_object = __pyx_t_4;

  /* "View.MemoryView":171
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
  if (__pyx_t_4) {

    /* "View.MemoryView":174
 * 
 * 
 *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
 *             if not self.data:
 *                 raise MemoryError("unable to allocate array data.")
 */
    __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));

    /* "View.MemoryView":175
 * 
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:             # <<<<<<<<<<<<<<
 *                 raise MemoryError("unable to allocate array data.")
 * 
 */
    __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "View.MemoryView":176
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:
 *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_is_object:
 */
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_Raise(__pyx_t_10, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __PYX_ERR(2, 176, __pyx_L1_error)

      /* "View.MemoryView":175
 * 
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:             # <<<<<<<<<<<<<<
 *                 raise MemoryError("unable to allocate array data.")
 * 
 */
    }

    /* "View.MemoryView":178
 *                 raise MemoryError("unable to allocate array data.")
 * 
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):
 */
    __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
    if (__pyx_t_4) {

      /* "View.MemoryView":179
 * 
 *             if self.dtype_is_object:
 *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
 *                 for i in range(self.len / itemsize):
 *                     p[i] = Py_None
 */
      __pyx_v_p = ((PyObject **)__pyx_v_self->data);

      /* "View.MemoryView":180
 *             if self.dtype_is_object:
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
 *                     p[i] = Py_None
 *                     Py_INCREF(Py_None)
 */
      if (unlikely(__pyx_v_itemsize == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        __PYX_ERR(2, 180, __pyx_L1_error)
      }
      else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
        PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
        __PYX_ERR(2, 180, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
      __pyx_t_9 = __pyx_t_1;
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
        __pyx_v_i = __pyx_t_11;

        /* "View.MemoryView":181
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):
 *                     p[i] = Py_None             # <<<<<<<<<<<<<<
 *                     Py_INCREF(Py_None)
 * 
 */
        (__pyx_v_p[__pyx_v_i]) = Py_None;

        /* "View.MemoryView":182
 *                 for i in range(self.len / itemsize):
 *                     p[i] = Py_None
 *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
        Py_INCREF(Py_None);
      }

      /* "View.MemoryView":178
 *                 raise MemoryError("unable to allocate array data.")
 * 
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 p = <PyObject **> self.data
 *                 for i in range(self.len / itemsize):
 */
    }

    /* "View.MemoryView":171
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  }

  /* "View.MemoryView":122
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_format);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":185
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         cdef int bufmode = -1
 *         if self.mode == u"c":
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_bufmode;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_v_info == NULL) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_info->obj);

  /* "View.MemoryView":186
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
 *         if self.mode == u"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 */
  __pyx_v_bufmode = -1;

  /* "View.MemoryView":187
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 *         if self.mode == u"c":             # <<<<<<<<<<<<<<
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":188
 *         cdef int bufmode = -1
 *         if self.mode == u"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *         elif self.mode == u"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 */
    __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);

    /* "View.MemoryView":187
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 *         if self.mode == u"c":             # <<<<<<<<<<<<<<
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":189
 *         if self.mode == u"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":190
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 */
    __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);

    /* "View.MemoryView":189
 *         if self.mode == u"c":
 *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 */
  }
  __pyx_L3:;

  /* "View.MemoryView":191
 *         elif self.mode == u"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data
 */
  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":192
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
 *         info.buf = self.data
 *         info.len = self.len
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 192, __pyx_L1_error)

    /* "View.MemoryView":191
 *         elif self.mode == u"fortran":
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data
 */
  }

  /* "View.MemoryView":193
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data             # <<<<<<<<<<<<<<
 *         info.len = self.len
 *         info.ndim = self.ndim
 */
  __pyx_t_4 = __pyx_v_self->data;
  __pyx_v_info->buf = __pyx_t_4;

  /* "View.MemoryView":194
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")
 *         info.buf = self.data
 *         info.len = self.len             # <<<<<<<<<<<<<<
 *         info.ndim = self.ndim
 *         info.shape = self._shape
 */
  __pyx_t_5 = __pyx_v_self->len;
  __pyx_v_info->len = __pyx_t_5;

  /* "View.MemoryView":195
 *         info.buf = self.data
 *         info.len = self.len
 *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
 *         info.shape = self._shape
 *         info.strides = self._strides
 */
  __pyx_t_6 = __pyx_v_self->ndim;
  __pyx_v_info->ndim = __pyx_t_6;

  /* "View.MemoryView":196
 *         info.len = self.len
 *         info.ndim = self.ndim
 *         info.shape = self._shape             # <<<<<<<<<<<<<<
 *         info.strides = self._strides
 *         info.suboffsets = NULL
 */
  __pyx_t_7 = __pyx_v_self->_shape;
  __pyx_v_info->shape = __pyx_t_7;

  /* "View.MemoryView":197
 *         info.ndim = self.ndim
 *         info.shape = self._shape
 *         info.strides = self._strides             # <<<<<<<<<<<<<<
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize
 */
  __pyx_t_7 = __pyx_v_self->_strides;
  __pyx_v_info->strides = __pyx_t_7;

  /* "View.MemoryView":198
 *         info.shape = self._shape
 *         info.strides = self._strides
 *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *         info.itemsize = self.itemsize
 *         info.readonly = 0
 */
  __pyx_v_info->suboffsets = NULL;

  /* "View.MemoryView":199
 *         info.strides = self._strides
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
 *         info.readonly = 0
 * 
 */
  __pyx_t_5 = __pyx_v_self->itemsize;
  __pyx_v_info->itemsize = __pyx_t_5;

  /* "View.MemoryView":200
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize
 *         info.readonly = 0             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
  __pyx_v_info->readonly = 0;

  /* "View.MemoryView":202
 *         info.readonly = 0
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.format
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":203
 * 
 *         if flags & PyBUF_FORMAT:
 *             info.format = self.format             # <<<<<<<<<<<<<<
 *         else:
 *             info.format = NULL
 */
    __pyx_t_4 = __pyx_v_self->format;
    __pyx_v_info->format = __pyx_t_4;

    /* "View.MemoryView":202
 *         info.readonly = 0
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.format
 *         else:
 */
    goto __pyx_L5;
  }

  /* "View.MemoryView":205
 *             info.format = self.format
 *         else:
 *             info.format = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.obj = self
 */
  /*else*/ {
    __pyx_v_info->format = NULL;
  }
  __pyx_L5:;

  /* "View.MemoryView":207
 *             info.format = NULL
 * 
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "View.MemoryView":185
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         cdef int bufmode = -1
 *         if self.mode == u"c":
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":211
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 */

/* Python wrapper */
static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":212
 * 
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
 *             self.callback_free_data(self.data)
 *         elif self.free_data:
 */
  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":213
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
 *         elif self.free_data:
 *             if self.dtype_is_object:
 */
    __pyx_v_self->callback_free_data(__pyx_v_self->data);

    /* "View.MemoryView":212
 * 
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
 *             self.callback_free_data(self.data)
 *         elif self.free_data:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":214
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 *         elif self.free_data:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape,
 */
  __pyx_t_1 = (__pyx_v_self->free_data != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":215
 *             self.callback_free_data(self.data)
 *         elif self.free_data:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 refcount_objects_in_slice(self.data, self._shape,
 *                                           self._strides, self.ndim, False)
 */
    __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":216
 *         elif self.free_data:
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
 *                                           self._strides, self.ndim, False)
 *             free(self.data)
 */
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);

      /* "View.MemoryView":215
 *             self.callback_free_data(self.data)
 *         elif self.free_data:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 refcount_objects_in_slice(self.data, self._shape,
 *                                           self._strides, self.ndim, False)
 */
    }

    /* "View.MemoryView":218
 *                 refcount_objects_in_slice(self.data, self._shape,
 *                                           self._strides, self.ndim, False)
 *             free(self.data)             # <<<<<<<<<<<<<<
 *         PyObject_Free(self._shape)
 * 
 */
    free(__pyx_v_self->data);

    /* "View.MemoryView":214
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 *         elif self.free_data:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape,
 */
  }
  __pyx_L3:;

  /* "View.MemoryView":219
 *                                           self._strides, self.ndim, False)
 *             free(self.data)
 *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  PyObject_Free(__pyx_v_self->_shape);

  /* "View.MemoryView":211
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":222
 * 
 *     @property
 *     def memview(self):             # <<<<<<<<<<<<<<
 *         return self.get_memview()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":223
 *     @property
 *     def memview(self):
 *         return self.get_memview()             # <<<<<<<<<<<<<<
 * 
 *     @cname('get_memview')
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":222
 * 
 *     @property
 *     def memview(self):             # <<<<<<<<<<<<<<
 *         return self.get_memview()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":226
 * 
 *     @cname('get_memview')
 *     cdef get_memview(self):             # <<<<<<<<<<<<<<
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *         return  memoryview(self, flags, self.dtype_is_object)
 */

static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_memview", 0);

  /* "View.MemoryView":227
 *     @cname('get_memview')
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
 */
  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);

  /* "View.MemoryView":228
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":226
 * 
 *     @cname('get_memview')
 *     cdef get_memview(self):             # <<<<<<<<<<<<<<
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *         return  memoryview(self, flags, self.dtype_is_object)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":230
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._shape[0]
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "View.MemoryView":231
 * 
 *     def __len__(self):
 *         return self._shape[0]             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, attr):
 */
  __pyx_r = (__pyx_v_self->_shape[0]);
  goto __pyx_L0;

  /* "View.MemoryView":230
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._shape[0]
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":233
 *         return self._shape[0]
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "View.MemoryView":234
 * 
 *     def __getattr__(self, attr):
 *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, item):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":233
 *         return self._shape[0]
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":236
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "View.MemoryView":237
 * 
 *     def __getitem__(self, item):
 *         return self.memview[item]             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, item, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":236
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":239
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
 */

/* Python wrapper */
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "View.MemoryView":240
 * 
 *     def __setitem__(self, item, value):
 *         self.memview[item] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":239
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":244
 * 
 * @cname("__pyx_array_new")
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
 *                           char *mode, char *buf):
 *     cdef array result
 */

static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
  struct __pyx_array_obj *__pyx_v_result = 0;
  struct __pyx_array_obj *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("array_cwrapper", 0);

  /* "View.MemoryView":248
 *     cdef array result
 * 
 *     if buf == NULL:             # <<<<<<<<<<<<<<
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":249
 * 
 *     if buf == NULL:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),
 */
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_shape);
    __Pyx_GIVEREF(__pyx_v_shape);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "View.MemoryView":248
 *     cdef array result
 * 
 *     if buf == NULL:             # <<<<<<<<<<<<<<
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":251
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
 *                        allocate_buffer=False)
 *         result.data = buf
 */
  /*else*/ {
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_shape);
    __Pyx_GIVEREF(__pyx_v_shape);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_3 = 0;

    /* "View.MemoryView":252
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),
 *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
 *         result.data = buf
 * 
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error)

    /* "View.MemoryView":251
 *         result = array(shape, itemsize, format, mode.decode('ASCII'))
 *     else:
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
 *                        allocate_buffer=False)
 *         result.data = buf
 */
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "View.MemoryView":253
 *         result = array(shape, itemsize, format, mode.decode('ASCII'),
 *                        allocate_buffer=False)
 *         result.data = buf             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_v_result->data = __pyx_v_buf;
  }
  __pyx_L3:;

  /* "View.MemoryView":255
 *         result.data = buf
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":244
 * 
 * @cname("__pyx_array_new")
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
 *                           char *mode, char *buf):
 *     cdef array result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":281
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
 */

/* Python wrapper */
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name_2,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "View.MemoryView":282
 *     cdef object name
 *     def __init__(self, name):
 *         self.name = name             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return self.name
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "View.MemoryView":281
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":283
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
 */

/* Python wrapper */
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "View.MemoryView":284
 *         self.name = name
 *     def __repr__(self):
 *         return self.name             # <<<<<<<<<<<<<<
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* "View.MemoryView":283
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.name,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_v_self->name);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.name,)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.name,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.name is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.name,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
 */
  /*else*/ {
    __pyx_t_3 = (__pyx_v_self->name != Py_None);
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.name is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
 *     else:
 */
  __pyx_t_3 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_3) {

    /* "(tree fragment)":13
 *         use_setstate = self.name is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_184977713);
    __Pyx_GIVEREF(__pyx_int_184977713);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.name is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_184977713);
    __Pyx_GIVEREF(__pyx_int_184977713);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":298
 * 
 * @cname('__pyx_align_pointer')
 * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
 *     "Align pointer memory on a given boundary"
 *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
 */

static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
  Py_intptr_t __pyx_v_aligned_p;
  size_t __pyx_v_offset;
  void *__pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":300
 * cdef void *align_pointer(void *memory, size_t alignment) nogil:
 *     "Align pointer memory on a given boundary"
 *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
 *     cdef size_t offset
 * 
 */
  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);

  /* "View.MemoryView":304
 * 
 *     with cython.cdivision(True):
 *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
 * 
 *     if offset > 0:
 */
  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);

  /* "View.MemoryView":306
 *         offset = aligned_p % alignment
 * 
 *     if offset > 0:             # <<<<<<<<<<<<<<
 *         aligned_p += alignment - offset
 * 
 */
  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":307
 * 
 *     if offset > 0:
 *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
 * 
 *     return <void *> aligned_p
 */
    __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));

    /* "View.MemoryView":306
 *         offset = aligned_p % alignment
 * 
 *     if offset > 0:             # <<<<<<<<<<<<<<
 *         aligned_p += alignment - offset
 * 
 */
  }

  /* "View.MemoryView":309
 *         aligned_p += alignment - offset
 * 
 *     return <void *> aligned_p             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((void *)__pyx_v_aligned_p);
  goto __pyx_L0;

  /* "View.MemoryView":298
 * 
 * @cname('__pyx_align_pointer')
 * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
 *     "Align pointer memory on a given boundary"
 *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":345
 *     cdef __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
 */

/* Python wrapper */
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  int __pyx_v_flags;
  int __pyx_v_dtype_is_object;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
    } else {
      __pyx_v_dtype_is_object = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "View.MemoryView":346
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj             # <<<<<<<<<<<<<<
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 */
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  __Pyx_GOTREF(__pyx_v_self->obj);
  __Pyx_DECREF(__pyx_v_self->obj);
  __pyx_v_self->obj = __pyx_v_obj;

  /* "View.MemoryView":347
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj
 *         self.flags = flags             # <<<<<<<<<<<<<<
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 */
  __pyx_v_self->flags = __pyx_v_flags;

  /* "View.MemoryView":348
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 */
  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_obj != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "View.MemoryView":349
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 */
    __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 349, __pyx_L1_error)

    /* "View.MemoryView":350
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
 */
    __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":351
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
 *                 Py_INCREF(Py_None)
 * 
 */
      ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;

      /* "View.MemoryView":352
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *         global __pyx_memoryview_thread_locks_used
 */
      Py_INCREF(Py_None);

      /* "View.MemoryView":350
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
 */
    }

    /* "View.MemoryView":348
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 */
  }

  /* "View.MemoryView":355
 * 
 *         global __pyx_memoryview_thread_locks_used
 *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
 *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *             __pyx_memoryview_thread_locks_used += 1
 */
  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":356
 *         global __pyx_memoryview_thread_locks_used
 *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
 *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
 *             __pyx_memoryview_thread_locks_used += 1
 *         if self.lock is NULL:
 */
    __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);

    /* "View.MemoryView":357
 *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
 *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *             __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
 *         if self.lock is NULL:
 *             self.lock = PyThread_allocate_lock()
 */
    __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);

    /* "View.MemoryView":355
 * 
 *         global __pyx_memoryview_thread_locks_used
 *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
 *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *             __pyx_memoryview_thread_locks_used += 1
 */
  }

  /* "View.MemoryView":358
 *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *             __pyx_memoryview_thread_locks_used += 1
 *         if self.lock is NULL:             # <<<<<<<<<<<<<<
 *             self.lock = PyThread_allocate_lock()
 *             if self.lock is NULL:
 */
  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":359
 *             __pyx_memoryview_thread_locks_used += 1
 *         if self.lock is NULL:
 *             self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
 *             if self.lock is NULL:
 *                 raise MemoryError
 */
    __pyx_v_self->lock = PyThread_allocate_lock();

    /* "View.MemoryView":360
 *         if self.lock is NULL:
 *             self.lock = PyThread_allocate_lock()
 *             if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 * 
 */
    __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "View.MemoryView":361
 *             self.lock = PyThread_allocate_lock()
 *             if self.lock is NULL:
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
      PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error)

      /* "View.MemoryView":360
 *         if self.lock is NULL:
 *             self.lock = PyThread_allocate_lock()
 *             if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 * 
 */
    }

    /* "View.MemoryView":358
 *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *             __pyx_memoryview_thread_locks_used += 1
 *         if self.lock is NULL:             # <<<<<<<<<<<<<<
 *             self.lock = PyThread_allocate_lock()
 *             if self.lock is NULL:
 */
  }

  /* "View.MemoryView":363
 *                 raise MemoryError
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":364
 * 
 *         if flags & PyBUF_FORMAT:
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
 *         else:
 *             self.dtype_is_object = dtype_is_object
 */
    __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L11_bool_binop_done:;
    __pyx_v_self->dtype_is_object = __pyx_t_1;

    /* "View.MemoryView":363
 *                 raise MemoryError
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
 */
    goto __pyx_L10;
  }

  /* "View.MemoryView":366
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
 *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
 * 
 *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
 */
  /*else*/ {
    __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
  }
  __pyx_L10:;

  /* "View.MemoryView":368
 *             self.dtype_is_object = dtype_is_object
 * 
 *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
 *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
 *         self.typeinfo = NULL
 */
  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));

  /* "View.MemoryView":370
 *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
 *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
 *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(memoryview self):
 */
  __pyx_v_self->typeinfo = NULL;

  /* "View.MemoryView":345
 *     cdef __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":372
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 */

/* Python wrapper */
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
  int __pyx_v_i;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyThread_type_lock __pyx_t_6;
  PyThread_type_lock __pyx_t_7;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":373
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_ReleaseBuffer(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 */
  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":374
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 * 
 */
    __Pyx_ReleaseBuffer((&__pyx_v_self->view));

    /* "View.MemoryView":373
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_ReleaseBuffer(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":375
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
 */
  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":377
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL             # <<<<<<<<<<<<<<
 *             Py_DECREF(Py_None)
 * 
 */
    ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;

    /* "View.MemoryView":378
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
 *             Py_DECREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *         cdef int i
 */
    Py_DECREF(Py_None);

    /* "View.MemoryView":375
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
 */
  }
  __pyx_L3:;

  /* "View.MemoryView":382
 *         cdef int i
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 */
  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":383
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:
 *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 */
    __pyx_t_3 = __pyx_memoryview_thread_locks_used;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "View.MemoryView":384
 *         if self.lock != NULL:
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
 */
      __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":385
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 */
        __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);

        /* "View.MemoryView":386
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 */
        __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":388
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
 *                     break
 *             else:
 */
          __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
          __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);

          /* "View.MemoryView":387
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 *                     break
 */
          (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
          (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;

          /* "View.MemoryView":386
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 */
        }

        /* "View.MemoryView":389
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 *                     break             # <<<<<<<<<<<<<<
 *             else:
 *                 PyThread_free_lock(self.lock)
 */
        goto __pyx_L6_break;

        /* "View.MemoryView":384
 *         if self.lock != NULL:
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
 */
      }
    }
    /*else*/ {

      /* "View.MemoryView":391
 *                     break
 *             else:
 *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 */
      PyThread_free_lock(__pyx_v_self->lock);
    }
    __pyx_L6_break:;

    /* "View.MemoryView":382
 *         cdef int i
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 */
  }

  /* "View.MemoryView":372
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":393
 *                 PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
 */

static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  Py_ssize_t __pyx_v_dim;
  char *__pyx_v_itemp;
  PyObject *__pyx_v_idx = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item_pointer", 0);

  /* "View.MemoryView":395
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
 * 
 *         for dim, idx in enumerate(index):
 */
  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);

  /* "View.MemoryView":397
 *         cdef char *itemp = <char *> self.view.buf
 * 
 *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 */
  __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 397, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_dim = __pyx_t_1;
    __pyx_t_1 = (__pyx_t_1 + 1);

    /* "View.MemoryView":398
 * 
 *         for dim, idx in enumerate(index):
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
 * 
 *         return itemp
 */
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error)
    __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 398, __pyx_L1_error)
    __pyx_v_itemp = __pyx_t_7;

    /* "View.MemoryView":397
 *         cdef char *itemp = <char *> self.view.buf
 * 
 *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":400
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 *         return itemp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_itemp;
  goto __pyx_L0;

  /* "View.MemoryView":393
 *                 PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":403
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
 */

/* Python wrapper */
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_indices = NULL;
  char *__pyx_v_itemp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "View.MemoryView":404
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":405
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __pyx_r = ((PyObject *)__pyx_v_self);
    goto __pyx_L0;

    /* "View.MemoryView":404
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  }

  /* "View.MemoryView":407
 *             return self
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         cdef char *itemp
 */
  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(__pyx_t_3 != Py_None)) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(2, 407, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error)
  }
  __pyx_v_have_slices = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_indices = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "View.MemoryView":410
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "View.MemoryView":411
 *         cdef char *itemp
 *         if have_slices:
 *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
 *         else:
 *             itemp = self.get_item_pointer(indices)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":410
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
 */
  }

  /* "View.MemoryView":413
 *             return memview_slice(self, indices)
 *         else:
 *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
 *             return self.convert_item_to_object(itemp)
 * 
 */
  /*else*/ {
    __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error)
    __pyx_v_itemp = __pyx_t_6;

    /* "View.MemoryView":414
 *         else:
 *             itemp = self.get_item_pointer(indices)
 *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(memoryview self, object index, object value):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":403
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":416
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         if self.view.readonly:
 *             raise TypeError("Cannot assign to read-only memoryview")
 */

/* Python wrapper */
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_obj = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "View.MemoryView":417
 * 
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise TypeError("Cannot assign to read-only memoryview")
 * 
 */
  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":418
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:
 *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
 * 
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 418, __pyx_L1_error)

    /* "View.MemoryView":417
 * 
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise TypeError("Cannot assign to read-only memoryview")
 * 
 */
  }

  /* "View.MemoryView":420
 *             raise TypeError("Cannot assign to read-only memoryview")
 * 
 *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         if have_slices:
 */
  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(__pyx_t_2 != Py_None)) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(2, 420, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error)
  }
  __pyx_v_have_slices = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":422
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "View.MemoryView":423
 * 
 *         if have_slices:
 *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
 *             if obj:
 *                 self.setitem_slice_assignment(self[index], obj)
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_obj = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "View.MemoryView":424
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "View.MemoryView":425
 *             obj = self.is_slice(value)
 *             if obj:
 *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)
 */
      __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 425, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "View.MemoryView":424
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 */
      goto __pyx_L5;
    }

    /* "View.MemoryView":427
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
 *         else:
 *             self.setitem_indexed(index, value)
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error)
      __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L5:;

    /* "View.MemoryView":422
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj:
 */
    goto __pyx_L4;
  }

  /* "View.MemoryView":429
 *                 self.setitem_slice_assign_scalar(self[index], value)
 *         else:
 *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef is_slice(self, obj):
 */
  /*else*/ {
    __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "View.MemoryView":416
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         if self.view.readonly:
 *             raise TypeError("Cannot assign to read-only memoryview")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":431
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
 */

static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_slice", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "View.MemoryView":432
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":433
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "View.MemoryView":434
 *         if not isinstance(obj, memoryview):
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
 *                                  self.dtype_is_object)
 *             except TypeError:
 */
        __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "View.MemoryView":435
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
 *             except TypeError:
 *                 return None
 */
        __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);

        /* "View.MemoryView":434
 *         if not isinstance(obj, memoryview):
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
 *                                  self.dtype_is_object)
 *             except TypeError:
 */
        __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
        __pyx_t_6 = 0;
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "View.MemoryView":433
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "View.MemoryView":436
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_6);

        /* "View.MemoryView":437
 *                                  self.dtype_is_object)
 *             except TypeError:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         return obj
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_except_return;
      }
      goto __pyx_L6_except_error;
      __pyx_L6_except_error:;

      /* "View.MemoryView":433
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 */
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L7_except_return:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L0;
      __pyx_L9_try_end:;
    }

    /* "View.MemoryView":432
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 */
  }

  /* "View.MemoryView":439
 *                 return None
 * 
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assignment(self, dst, src):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "View.MemoryView":431
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":441
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
 */

static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
  __Pyx_memviewslice __pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_src_slice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  __Pyx_memviewslice *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);

  /* "View.MemoryView":445
 *         cdef __Pyx_memviewslice src_slice
 * 
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
 *                                  get_slice_from_memview(dst, &dst_slice)[0],
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 */
  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error)
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error)

  /* "View.MemoryView":446
 * 
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
 *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 * 
 */
  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error)
  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error)

  /* "View.MemoryView":447
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
 *                                  get_slice_from_memview(dst, &dst_slice)[0],
 *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "View.MemoryView":445
 *         cdef __Pyx_memviewslice src_slice
 * 
 *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
 *                                  get_slice_from_memview(dst, &dst_slice)[0],
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 */
  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 445, __pyx_L1_error)

  /* "View.MemoryView":441
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":449
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
 */

static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
  int __pyx_v_array[0x80];
  void *__pyx_v_tmp;
  void *__pyx_v_item;
  __Pyx_memviewslice *__pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_tmp_slice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  char const *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);

  /* "View.MemoryView":451
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
 *         cdef int array[128]
 *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
 *         cdef void *item
 * 
 */
  __pyx_v_tmp = NULL;

  /* "View.MemoryView":456
 *         cdef __Pyx_memviewslice *dst_slice
 *         cdef __Pyx_memviewslice tmp_slice
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
 */
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error)
  __pyx_v_dst_slice = __pyx_t_1;

  /* "View.MemoryView":458
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 */
  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":459
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
 *             if tmp == NULL:
 *                 raise MemoryError
 */
    __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);

    /* "View.MemoryView":460
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
 */
    __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "View.MemoryView":461
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *             item = tmp
 *         else:
 */
      PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error)

      /* "View.MemoryView":460
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
 */
    }

    /* "View.MemoryView":462
 *             if tmp == NULL:
 *                 raise MemoryError
 *             item = tmp             # <<<<<<<<<<<<<<
 *         else:
 *             item = <void *> array
 */
    __pyx_v_item = __pyx_v_tmp;

    /* "View.MemoryView":458
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":464
 *             item = tmp
 *         else:
 *             item = <void *> array             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  /*else*/ {
    __pyx_v_item = ((void *)__pyx_v_array);
  }
  __pyx_L3:;

  /* "View.MemoryView":466
 *             item = <void *> array
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value
 */
  /*try:*/ {

    /* "View.MemoryView":467
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 */
    __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":468
 *         try:
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)
 */
      (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);

      /* "View.MemoryView":467
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 */
      goto __pyx_L8;
    }

    /* "View.MemoryView":470
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 470, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L8:;

    /* "View.MemoryView":474
 * 
 * 
 *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 */
    __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":475
 * 
 *             if self.view.suboffsets != NULL:
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 *                                 item, self.dtype_is_object)
 */
      __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "View.MemoryView":474
 * 
 * 
 *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 */
    }

    /* "View.MemoryView":476
 *             if self.view.suboffsets != NULL:
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
 *                                 item, self.dtype_is_object)
 *         finally:
 */
    __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
  }

  /* "View.MemoryView":479
 *                                 item, self.dtype_is_object)
 *         finally:
 *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_indexed(self, index, value):
 */
  /*finally:*/ {
    /*normal exit:*/{
      PyMem_Free(__pyx_v_tmp);
      goto __pyx_L7;
    }
    __pyx_L6_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
      {
        PyMem_Free(__pyx_v_tmp);
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
      goto __pyx_L1_error;
    }
    __pyx_L7:;
  }

  /* "View.MemoryView":449
 *                                  src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":481
 *             PyMem_Free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
 */

static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  char *__pyx_v_itemp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_indexed", 0);

  /* "View.MemoryView":482
 * 
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
 *         self.assign_item_from_object(itemp, value)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error)
  __pyx_v_itemp = __pyx_t_1;

  /* "View.MemoryView":483
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":481
 *             PyMem_Free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":485
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_v_struct = NULL;
  PyObject *__pyx_v_bytesitem = 0;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_item_to_object", 0);

  /* "View.MemoryView":488
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef bytes bytesitem
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":491
 *         cdef bytes bytesitem
 * 
 *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
 */
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":492
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "View.MemoryView":493
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
 *         except struct.error:
 *             raise ValueError("Unable to convert item to object")
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
        __Pyx_INCREF(__pyx_v_bytesitem);
        __Pyx_GIVEREF(__pyx_v_bytesitem);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
        __pyx_t_6 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_result = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "View.MemoryView":492
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 */
    }

    /* "View.MemoryView":497
 *             raise ValueError("Unable to convert item to object")
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
 */
    /*else:*/ {
      __pyx_t_10 = strlen(__pyx_v_self->view.format); 
      __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
      if (__pyx_t_11) {

        /* "View.MemoryView":498
 *         else:
 *             if len(self.view.format) == 1:
 *                 return result[0]             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L6_except_return;

        /* "View.MemoryView":497
 *             raise ValueError("Unable to convert item to object")
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
 */
      }

      /* "View.MemoryView":499
 *             if len(self.view.format) == 1:
 *                 return result[0]
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L6_except_return;
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "View.MemoryView":494
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:             # <<<<<<<<<<<<<<
 *             raise ValueError("Unable to convert item to object")
 *         else:
 */
    __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
    __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
    if (__pyx_t_8) {
      __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_1);

      /* "View.MemoryView":495
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
 *         else:
 *             if len(self.view.format) == 1:
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(2, 495, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "View.MemoryView":492
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 */
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
  }

  /* "View.MemoryView":485
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesitem);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":501
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_struct = NULL;
  char __pyx_v_c;
  PyObject *__pyx_v_bytesvalue = 0;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  char *__pyx_t_11;
  char *__pyx_t_12;
  char *__pyx_t_13;
  char *__pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":504
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef char c
 *         cdef bytes bytesvalue
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":509
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_value); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "View.MemoryView":510
 * 
 *         if isinstance(value, tuple):
 *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 510, __pyx_L1_error)
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "View.MemoryView":509
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":512
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
 * 
 *         for i, c in enumerate(bytesvalue):
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
      __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error)
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":514
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
 */
  __pyx_t_9 = 0;
  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    __PYX_ERR(2, 514, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_v_bytesvalue);
  __pyx_t_10 = __pyx_v_bytesvalue;
  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
    __pyx_t_11 = __pyx_t_14;
    __pyx_v_c = (__pyx_t_11[0]);

    /* "View.MemoryView":515
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
    __pyx_v_i = __pyx_t_9;

    /* "View.MemoryView":514
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
 */
    __pyx_t_9 = (__pyx_t_9 + 1);

    /* "View.MemoryView":515
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
    (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "View.MemoryView":501
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":518
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
 *             raise ValueError("Cannot create writable memory view from read-only memoryview")
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t *__pyx_t_4;
  char *__pyx_t_5;
  void *__pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_v_info == NULL) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_info->obj);

  /* "View.MemoryView":519
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot create writable memory view from read-only memoryview")
 * 
 */
  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":520
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
 *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_ND:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 520, __pyx_L1_error)

    /* "View.MemoryView":519
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot create writable memory view from read-only memoryview")
 * 
 */
  }

  /* "View.MemoryView":522
 *             raise ValueError("Cannot create writable memory view from read-only memoryview")
 * 
 *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
 *             info.shape = self.view.shape
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":523
 * 
 *         if flags & PyBUF_ND:
 *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
 *         else:
 *             info.shape = NULL
 */
    __pyx_t_4 = __pyx_v_self->view.shape;
    __pyx_v_info->shape = __pyx_t_4;

    /* "View.MemoryView":522
 *             raise ValueError("Cannot create writable memory view from read-only memoryview")
 * 
 *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
 *             info.shape = self.view.shape
 *         else:
 */
    goto __pyx_L6;
  }

  /* "View.MemoryView":525
 *             info.shape = self.view.shape
 *         else:
 *             info.shape = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_STRIDES:
 */
  /*else*/ {
    __pyx_v_info->shape = NULL;
  }
  __pyx_L6:;

  /* "View.MemoryView":527
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":528
 * 
 *         if flags & PyBUF_STRIDES:
 *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
 *         else:
 *             info.strides = NULL
 */
    __pyx_t_4 = __pyx_v_self->view.strides;
    __pyx_v_info->strides = __pyx_t_4;

    /* "View.MemoryView":527
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
 */
    goto __pyx_L7;
  }

  /* "View.MemoryView":530
 *             info.strides = self.view.strides
 *         else:
 *             info.strides = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_INDIRECT:
 */
  /*else*/ {
    __pyx_v_info->strides = NULL;
  }
  __pyx_L7:;

  /* "View.MemoryView":532
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":533
 * 
 *         if flags & PyBUF_INDIRECT:
 *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
 *         else:
 *             info.suboffsets = NULL
 */
    __pyx_t_4 = __pyx_v_self->view.suboffsets;
    __pyx_v_info->suboffsets = __pyx_t_4;

    /* "View.MemoryView":532
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
 */
    goto __pyx_L8;
  }

  /* "View.MemoryView":535
 *             info.suboffsets = self.view.suboffsets
 *         else:
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
  /*else*/ {
    __pyx_v_info->suboffsets = NULL;
  }
  __pyx_L8:;

  /* "View.MemoryView":537
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":538
 * 
 *         if flags & PyBUF_FORMAT:
 *             info.format = self.view.format             # <<<<<<<<<<<<<<
 *         else:
 *             info.format = NULL
 */
    __pyx_t_5 = __pyx_v_self->view.format;
    __pyx_v_info->format = __pyx_t_5;

    /* "View.MemoryView":537
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
 */
    goto __pyx_L9;
  }

  /* "View.MemoryView":540
 *             info.format = self.view.format
 *         else:
 *             info.format = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.buf = self.view.buf
 */
  /*else*/ {
    __pyx_v_info->format = NULL;
  }
  __pyx_L9:;

  /* "View.MemoryView":542
 *             info.format = NULL
 * 
 *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
 */
  __pyx_t_6 = __pyx_v_self->view.buf;
  __pyx_v_info->buf = __pyx_t_6;

  /* "View.MemoryView":543
 * 
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
 */
  __pyx_t_7 = __pyx_v_self->view.ndim;
  __pyx_v_info->ndim = __pyx_t_7;

  /* "View.MemoryView":544
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
 *         info.len = self.view.len
 *         info.readonly = self.view.readonly
 */
  __pyx_t_8 = __pyx_v_self->view.itemsize;
  __pyx_v_info->itemsize = __pyx_t_8;

  /* "View.MemoryView":545
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len             # <<<<<<<<<<<<<<
 *         info.readonly = self.view.readonly
 *         info.obj = self
 */
  __pyx_t_8 = __pyx_v_self->view.len;
  __pyx_v_info->len = __pyx_t_8;

  /* "View.MemoryView":546
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
 *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
 *         info.obj = self
 * 
 */
  __pyx_t_1 = __pyx_v_self->view.readonly;
  __pyx_v_info->readonly = __pyx_t_1;

  /* "View.MemoryView":547
 *         info.len = self.view.len
 *         info.readonly = self.view.readonly
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "View.MemoryView":518
 * 
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
 *             raise ValueError("Cannot create writable memory view from read-only memoryview")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":553
 * 
 *     @property
 *     def T(self):             # <<<<<<<<<<<<<<
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":554
 *     @property
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&result.from_slice)
 *         return result
 */
  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":555
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error)

  /* "View.MemoryView":556
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":553
 * 
 *     @property
 *     def T(self):             # <<<<<<<<<<<<<<
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":559
 * 
 *     @property
 *     def base(self):             # <<<<<<<<<<<<<<
 *         return self.obj
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":560
 *     @property
 *     def base(self):
 *         return self.obj             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->obj);
  __pyx_r = __pyx_v_self->obj;
  goto __pyx_L0;

  /* "View.MemoryView":559
 * 
 *     @property
 *     def base(self):             # <<<<<<<<<<<<<<
 *         return self.obj
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":563
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":564
 *     @property
 *     def shape(self):
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_v_length = (__pyx_t_2[0]);
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":563
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":567
 * 
 *     @property
 *     def strides(self):             # <<<<<<<<<<<<<<
 *         if self.view.strides == NULL:
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_v_stride;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":568
 *     @property
 *     def strides(self):
 *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError("Buffer view does not expose strides")
 */
  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":570
 *         if self.view.strides == NULL:
 * 
 *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
 * 
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 570, __pyx_L1_error)

    /* "View.MemoryView":568
 *     @property
 *     def strides(self):
 *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError("Buffer view does not expose strides")
 */
  }

  /* "View.MemoryView":572
 *             raise ValueError("Buffer view does not expose strides")
 * 
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
    __pyx_t_3 = __pyx_t_5;
    __pyx_v_stride = (__pyx_t_3[0]);
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":567
 * 
 *     @property
 *     def strides(self):             # <<<<<<<<<<<<<<
 *         if self.view.strides == NULL:
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":575
 * 
 *     @property
 *     def suboffsets(self):             # <<<<<<<<<<<<<<
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_v_suboffset;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  Py_ssize_t *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":576
 *     @property
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             return (-1,) * self.view.ndim
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":577
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__53, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":576
 *     @property
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             return (-1,) * self.view.ndim
 * 
 */
  }

  /* "View.MemoryView":579
 *             return (-1,) * self.view.ndim
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
    __pyx_t_4 = __pyx_t_6;
    __pyx_v_suboffset = (__pyx_t_4[0]);
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":575
 * 
 *     @property
 *     def suboffsets(self):             # <<<<<<<<<<<<<<
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":582
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.view.ndim
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":583
 *     @property
 *     def ndim(self):
 *         return self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":582
 * 
 *     @property
 *     def ndim(self):             # <<<<<<<<<<<<<<
 *         return self.view.ndim
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":586
 * 
 *     @property
 *     def itemsize(self):             # <<<<<<<<<<<<<<
 *         return self.view.itemsize
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":587
 *     @property
 *     def itemsize(self):
 *         return self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":586
 * 
 *     @property
 *     def itemsize(self):             # <<<<<<<<<<<<<<
 *         return self.view.itemsize
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":590
 * 
 *     @property
 *     def nbytes(self):             # <<<<<<<<<<<<<<
 *         return self.size * self.view.itemsize
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":591
 *     @property
 *     def nbytes(self):
 *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __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;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":590
 * 
 *     @property
 *     def nbytes(self):             # <<<<<<<<<<<<<<
 *         return self.size * self.view.itemsize
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":594
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         if self._size is None:
 *             result = 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":595
 *     @property
 *     def size(self):
 *         if self._size is None:             # <<<<<<<<<<<<<<
 *             result = 1
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":596
 *     def size(self):
 *         if self._size is None:
 *             result = 1             # <<<<<<<<<<<<<<
 * 
 *             for length in self.view.shape[:self.view.ndim]:
 */
    __Pyx_INCREF(__pyx_int_1);
    __pyx_v_result = __pyx_int_1;

    /* "View.MemoryView":598
 *             result = 1
 * 
 *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
 *                 result *= length
 * 
 */
    __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
    for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "View.MemoryView":599
 * 
 *             for length in self.view.shape[:self.view.ndim]:
 *                 result *= length             # <<<<<<<<<<<<<<
 * 
 *             self._size = result
 */
      __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
      __pyx_t_6 = 0;
    }

    /* "View.MemoryView":601
 *                 result *= length
 * 
 *             self._size = result             # <<<<<<<<<<<<<<
 * 
 *         return self._size
 */
    __Pyx_INCREF(__pyx_v_result);
    __Pyx_GIVEREF(__pyx_v_result);
    __Pyx_GOTREF(__pyx_v_self->_size);
    __Pyx_DECREF(__pyx_v_self->_size);
    __pyx_v_self->_size = __pyx_v_result;

    /* "View.MemoryView":595
 *     @property
 *     def size(self):
 *         if self._size is None:             # <<<<<<<<<<<<<<
 *             result = 1
 * 
 */
  }

  /* "View.MemoryView":603
 *             self._size = result
 * 
 *         return self._size             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_size);
  __pyx_r = __pyx_v_self->_size;
  goto __pyx_L0;

  /* "View.MemoryView":594
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         if self._size is None:
 *             result = 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":605
 *         return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
 */

/* Python wrapper */
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "View.MemoryView":606
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":607
 *     def __len__(self):
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
    __pyx_r = (__pyx_v_self->view.shape[0]);
    goto __pyx_L0;

    /* "View.MemoryView":606
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
 */
  }

  /* "View.MemoryView":609
 *             return self.view.shape[0]
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":605
 *         return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":611
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
 */

/* Python wrapper */
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "View.MemoryView":612
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":613
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "View.MemoryView":612
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":611
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":615
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "View.MemoryView":616
 * 
 *     def __str__(self):
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":615
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":619
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_c_contig", 0);

  /* "View.MemoryView":622
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":623
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def is_f_contig(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":619
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":625
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_f_contig", 0);

  /* "View.MemoryView":628
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":629
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":625
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":631
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_mslice;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "View.MemoryView":633
 *     def copy(self):
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &mslice)
 */
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));

  /* "View.MemoryView":635
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 * 
 *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
 *                                    self.view.itemsize,
 */
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));

  /* "View.MemoryView":636
 * 
 *         slice_copy(self, &mslice)
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
 *                                    self.view.itemsize,
 *                                    flags|PyBUF_C_CONTIGUOUS,
 */
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 636, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":641
 *                                    self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
 * 
 *     def copy_fortran(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":631
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":643
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy_fortran", 0);

  /* "View.MemoryView":645
 *     def copy_fortran(self):
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &src)
 */
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));

  /* "View.MemoryView":647
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 * 
 *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
 *                                 self.view.itemsize,
 */
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));

  /* "View.MemoryView":648
 * 
 *         slice_copy(self, &src)
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
 *                                 self.view.itemsize,
 *                                 flags|PyBUF_F_CONTIGUOUS,
 */
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 648, __pyx_L1_error)
  __pyx_v_dst = __pyx_t_1;

  /* "View.MemoryView":653
 *                                 self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":643
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":657
 * 
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 */

static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
  struct __pyx_memoryview_obj *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);

  /* "View.MemoryView":658
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
 *     result.typeinfo = typeinfo
 *     return result
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_o);
  __Pyx_GIVEREF(__pyx_v_o);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "View.MemoryView":659
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_v_result->typeinfo = __pyx_v_typeinfo;

  /* "View.MemoryView":660
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_check')
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":657
 * 
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":663
 * 
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
 *     return isinstance(o, memoryview)
 * 
 */

static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("memoryview_check", 0);

  /* "View.MemoryView":664
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o):
 *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
 * 
 * cdef tuple _unellipsify(object index, int ndim):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "View.MemoryView":663
 * 
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
 *     return isinstance(o, memoryview)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":666
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
 */

static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
  PyObject *__pyx_v_tup = NULL;
  PyObject *__pyx_v_result = NULL;
  int __pyx_v_have_slices;
  int __pyx_v_seen_ellipsis;
  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
  PyObject *__pyx_v_item = NULL;
  Py_ssize_t __pyx_v_nslices;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_unellipsify", 0);

  /* "View.MemoryView":671
 *     full slices.
 *     """
 *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
 *         tup = (index,)
 *     else:
 */
  __pyx_t_1 = PyTuple_Check(__pyx_v_index); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":672
 *     """
 *     if not isinstance(index, tuple):
 *         tup = (index,)             # <<<<<<<<<<<<<<
 *     else:
 *         tup = index
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __pyx_v_tup = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "View.MemoryView":671
 *     full slices.
 *     """
 *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
 *         tup = (index,)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":674
 *         tup = (index,)
 *     else:
 *         tup = index             # <<<<<<<<<<<<<<
 * 
 *     result = []
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_index);
    __pyx_v_tup = __pyx_v_index;
  }
  __pyx_L3:;

  /* "View.MemoryView":676
 *         tup = index
 * 
 *     result = []             # <<<<<<<<<<<<<<
 *     have_slices = False
 *     seen_ellipsis = False
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "View.MemoryView":677
 * 
 *     result = []
 *     have_slices = False             # <<<<<<<<<<<<<<
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):
 */
  __pyx_v_have_slices = 0;

  /* "View.MemoryView":678
 *     result = []
 *     have_slices = False
 *     seen_ellipsis = False             # <<<<<<<<<<<<<<
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:
 */
  __pyx_v_seen_ellipsis = 0;

  /* "View.MemoryView":679
 *     have_slices = False
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_3 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
    __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 679, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "View.MemoryView":680
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 */
    __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":681
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 *                 seen_ellipsis = True
 */
      __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
      if (__pyx_t_1) {

        /* "View.MemoryView":682
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
 *                 seen_ellipsis = True
 *             else:
 */
        __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
        __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 682, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        { Py_ssize_t __pyx_temp;
          for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
            __Pyx_INCREF(__pyx_slice__14);
            __Pyx_GIVEREF(__pyx_slice__14);
            PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__14);
          }
        }
        __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "View.MemoryView":683
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
 *             else:
 *                 result.append(slice(None))
 */
        __pyx_v_seen_ellipsis = 1;

        /* "View.MemoryView":681
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 *                 seen_ellipsis = True
 */
        goto __pyx_L7;
      }

      /* "View.MemoryView":685
 *                 seen_ellipsis = True
 *             else:
 *                 result.append(slice(None))             # <<<<<<<<<<<<<<
 *             have_slices = True
 *         else:
 */
      /*else*/ {
        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__14); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 685, __pyx_L1_error)
      }
      __pyx_L7:;

      /* "View.MemoryView":686
 *             else:
 *                 result.append(slice(None))
 *             have_slices = True             # <<<<<<<<<<<<<<
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):
 */
      __pyx_v_have_slices = 1;

      /* "View.MemoryView":680
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
 */
      goto __pyx_L6;
    }

    /* "View.MemoryView":688
 *             have_slices = True
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Cannot index with type '%s'" % type(item))
 * 
 */
    /*else*/ {
      __pyx_t_2 = PySlice_Check(__pyx_v_item); 
      __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
      if (__pyx_t_10) {
      } else {
        __pyx_t_1 = __pyx_t_10;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
      __pyx_t_1 = __pyx_t_10;
      __pyx_L9_bool_binop_done:;
      if (unlikely(__pyx_t_1)) {

        /* "View.MemoryView":689
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):
 *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
 * 
 *             have_slices = have_slices or isinstance(item, slice)
 */
        __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_Raise(__pyx_t_11, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(2, 689, __pyx_L1_error)

        /* "View.MemoryView":688
 *             have_slices = True
 *         else:
 *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
 *                 raise TypeError("Cannot index with type '%s'" % type(item))
 * 
 */
      }

      /* "View.MemoryView":691
 *                 raise TypeError("Cannot index with type '%s'" % type(item))
 * 
 *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
 *             result.append(item)
 * 
 */
      __pyx_t_10 = (__pyx_v_have_slices != 0);
      if (!__pyx_t_10) {
      } else {
        __pyx_t_1 = __pyx_t_10;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_10 = PySlice_Check(__pyx_v_item); 
      __pyx_t_2 = (__pyx_t_10 != 0);
      __pyx_t_1 = __pyx_t_2;
      __pyx_L11_bool_binop_done:;
      __pyx_v_have_slices = __pyx_t_1;

      /* "View.MemoryView":692
 * 
 *             have_slices = have_slices or isinstance(item, slice)
 *             result.append(item)             # <<<<<<<<<<<<<<
 * 
 *     nslices = ndim - len(result)
 */
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error)
    }
    __pyx_L6:;

    /* "View.MemoryView":679
 *     have_slices = False
 *     seen_ellipsis = False
 *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "View.MemoryView":694
 *             result.append(item)
 * 
 *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
 *     if nslices:
 *         result.extend([slice(None)] * nslices)
 */
  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error)
  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);

  /* "View.MemoryView":695
 * 
 *     nslices = ndim - len(result)
 *     if nslices:             # <<<<<<<<<<<<<<
 *         result.extend([slice(None)] * nslices)
 * 
 */
  __pyx_t_1 = (__pyx_v_nslices != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":696
 *     nslices = ndim - len(result)
 *     if nslices:
 *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
 * 
 *     return have_slices or nslices, tuple(result)
 */
    __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
        __Pyx_INCREF(__pyx_slice__14);
        __Pyx_GIVEREF(__pyx_slice__14);
        PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__14);
      }
    }
    __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 696, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "View.MemoryView":695
 * 
 *     nslices = ndim - len(result)
 *     if nslices:             # <<<<<<<<<<<<<<
 *         result.extend([slice(None)] * nslices)
 * 
 */
  }

  /* "View.MemoryView":698
 *         result.extend([slice(None)] * nslices)
 * 
 *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 */
  __Pyx_XDECREF(__pyx_r);
  if (!__pyx_v_have_slices) {
  } else {
    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_L14_bool_binop_done:;
  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = ((PyObject*)__pyx_t_11);
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":666
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":700
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 */

static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_suboffset;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t *__pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);

  /* "View.MemoryView":701
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             raise ValueError("Indirect dimensions not supported")
 */
  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
    __pyx_t_1 = __pyx_t_3;
    __pyx_v_suboffset = (__pyx_t_1[0]);

    /* "View.MemoryView":702
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Indirect dimensions not supported")
 * 
 */
    __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "View.MemoryView":703
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(2, 703, __pyx_L1_error)

      /* "View.MemoryView":702
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Indirect dimensions not supported")
 * 
 */
    }
  }

  /* "View.MemoryView":700
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":710
 * 
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
 *     cdef bint negative_step
 */

static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
  int __pyx_v_new_ndim;
  int __pyx_v_suboffset_dim;
  int __pyx_v_dim;
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  __Pyx_memviewslice *__pyx_v_p_src;
  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
  __Pyx_memviewslice *__pyx_v_p_dst;
  int *__pyx_v_p_suboffset_dim;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  Py_ssize_t __pyx_v_step;
  int __pyx_v_have_start;
  int __pyx_v_have_stop;
  int __pyx_v_have_step;
  PyObject *__pyx_v_index = NULL;
  struct __pyx_memoryview_obj *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_memoryview_obj *__pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memview_slice", 0);

  /* "View.MemoryView":711
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
 *     cdef bint negative_step
 *     cdef __Pyx_memviewslice src, dst
 */
  __pyx_v_new_ndim = 0;
  __pyx_v_suboffset_dim = -1;

  /* "View.MemoryView":718
 * 
 * 
 *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
 * 
 *     cdef _memoryviewslice memviewsliceobj
 */
  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));

  /* "View.MemoryView":722
 *     cdef _memoryviewslice memviewsliceobj
 * 
 *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(2, 722, __pyx_L1_error)
    }
  }
  #endif

  /* "View.MemoryView":724
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":725
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
 *         p_src = &memviewsliceobj.from_slice
 *     else:
 */
    if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":726
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, &src)
 */
    __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);

    /* "View.MemoryView":724
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":728
 *         p_src = &memviewsliceobj.from_slice
 *     else:
 *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
 *         p_src = &src
 * 
 */
  /*else*/ {
    __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));

    /* "View.MemoryView":729
 *     else:
 *         slice_copy(memview, &src)
 *         p_src = &src             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_p_src = (&__pyx_v_src);
  }
  __pyx_L3:;

  /* "View.MemoryView":735
 * 
 * 
 *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
 *     dst.data = p_src.data
 * 
 */
  __pyx_t_4 = __pyx_v_p_src->memview;
  __pyx_v_dst.memview = __pyx_t_4;

  /* "View.MemoryView":736
 * 
 *     dst.memview = p_src.memview
 *     dst.data = p_src.data             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __pyx_v_p_src->data;
  __pyx_v_dst.data = __pyx_t_5;

  /* "View.MemoryView":741
 * 
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
 *     cdef int *p_suboffset_dim = &suboffset_dim
 *     cdef Py_ssize_t start, stop, step
 */
  __pyx_v_p_dst = (&__pyx_v_dst);

  /* "View.MemoryView":742
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst
 *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t start, stop, step
 *     cdef bint have_start, have_stop, have_step
 */
  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);

  /* "View.MemoryView":746
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             slice_memviewslice(
 */
  __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
    __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      }
    } else {
      __pyx_t_9 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(2, 746, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_9);
    }
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_v_dim = __pyx_t_6;
    __pyx_t_6 = (__pyx_t_6 + 1);

    /* "View.MemoryView":747
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             slice_memviewslice(
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 */
    __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":751
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
 *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 */
      __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error)

      /* "View.MemoryView":748
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):
 *             slice_memviewslice(             # <<<<<<<<<<<<<<
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
 */
      __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error)

      /* "View.MemoryView":747
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             slice_memviewslice(
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 */
      goto __pyx_L6;
    }

    /* "View.MemoryView":754
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 *         elif index is None:             # <<<<<<<<<<<<<<
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 */
    __pyx_t_2 = (__pyx_v_index == Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":755
 *                 False)
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
 */
      (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;

      /* "View.MemoryView":756
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1
 */
      (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;

      /* "View.MemoryView":757
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
 *             new_ndim += 1
 *         else:
 */
      (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;

      /* "View.MemoryView":758
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 *         else:
 *             start = index.start or 0
 */
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);

      /* "View.MemoryView":754
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 *         elif index is None:             # <<<<<<<<<<<<<<
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 */
      goto __pyx_L6;
    }

    /* "View.MemoryView":760
 *             new_ndim += 1
 *         else:
 *             start = index.start or 0             # <<<<<<<<<<<<<<
 *             stop = index.stop or 0
 *             step = index.step or 0
 */
    /*else*/ {
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error)
        __pyx_t_10 = __pyx_t_12;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_10 = 0;
      __pyx_L7_bool_binop_done:;
      __pyx_v_start = __pyx_t_10;

      /* "View.MemoryView":761
 *         else:
 *             start = index.start or 0
 *             stop = index.stop or 0             # <<<<<<<<<<<<<<
 *             step = index.step or 0
 * 
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error)
        __pyx_t_10 = __pyx_t_12;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_10 = 0;
      __pyx_L9_bool_binop_done:;
      __pyx_v_stop = __pyx_t_10;

      /* "View.MemoryView":762
 *             start = index.start or 0
 *             stop = index.stop or 0
 *             step = index.step or 0             # <<<<<<<<<<<<<<
 * 
 *             have_start = index.start is not None
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
        __pyx_t_10 = __pyx_t_12;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_10 = 0;
      __pyx_L11_bool_binop_done:;
      __pyx_v_step = __pyx_t_10;

      /* "View.MemoryView":764
 *             step = index.step or 0
 * 
 *             have_start = index.start is not None             # <<<<<<<<<<<<<<
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = (__pyx_t_9 != Py_None);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_have_start = __pyx_t_1;

      /* "View.MemoryView":765
 * 
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
 *             have_step = index.step is not None
 * 
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = (__pyx_t_9 != Py_None);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_have_stop = __pyx_t_1;

      /* "View.MemoryView":766
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None             # <<<<<<<<<<<<<<
 * 
 *             slice_memviewslice(
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = (__pyx_t_9 != Py_None);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_have_step = __pyx_t_1;

      /* "View.MemoryView":768
 *             have_step = index.step is not None
 * 
 *             slice_memviewslice(             # <<<<<<<<<<<<<<
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
 */
      __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 768, __pyx_L1_error)

      /* "View.MemoryView":774
 *                 have_start, have_stop, have_step,
 *                 True)
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
 */
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
    }
    __pyx_L6:;

    /* "View.MemoryView":746
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             slice_memviewslice(
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "View.MemoryView":776
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":777
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));

    /* "View.MemoryView":778
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_dtype_func,
 *                                     memview.dtype_is_object)
 */
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) }

    /* "View.MemoryView":779
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 *     else:
 */
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) }

    /* "View.MemoryView":777
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
 */
    __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error)
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":776
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 */
  }

  /* "View.MemoryView":782
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));

    /* "View.MemoryView":783
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
 *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "View.MemoryView":782
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
 */
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error)
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":710
 * 
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
 *     cdef bint negative_step
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":807
 * 
 * @cname('__pyx_memoryview_slice_memviewslice')
 * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
 *         __Pyx_memviewslice *dst,
 *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
 */

static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
  Py_ssize_t __pyx_v_new_shape;
  int __pyx_v_negative_step;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":827
 *     cdef bint negative_step
 * 
 *     if not is_slice:             # <<<<<<<<<<<<<<
 * 
 *         if start < 0:
 */
  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":829
 *     if not is_slice:
 * 
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start += shape
 *         if not 0 <= start < shape:
 */
    __pyx_t_1 = ((__pyx_v_start < 0) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":830
 * 
 *         if start < 0:
 *             start += shape             # <<<<<<<<<<<<<<
 *         if not 0 <= start < shape:
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
 */
      __pyx_v_start = (__pyx_v_start + __pyx_v_shape);

      /* "View.MemoryView":829
 *     if not is_slice:
 * 
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start += shape
 *         if not 0 <= start < shape:
 */
    }

    /* "View.MemoryView":831
 *         if start < 0:
 *             start += shape
 *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
 *     else:
 */
    __pyx_t_1 = (0 <= __pyx_v_start);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
    }
    __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":832
 *             start += shape
 *         if not 0 <= start < shape:
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
 *     else:
 * 
 */
      __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error)

      /* "View.MemoryView":831
 *         if start < 0:
 *             start += shape
 *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
 *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
 *     else:
 */
    }

    /* "View.MemoryView":827
 *     cdef bint negative_step
 * 
 *     if not is_slice:             # <<<<<<<<<<<<<<
 * 
 *         if start < 0:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":835
 *     else:
 * 
 *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
 * 
 *         if have_step and step == 0:
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_1 = ((__pyx_v_step < 0) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L6_bool_binop_done:;
    __pyx_v_negative_step = __pyx_t_2;

    /* "View.MemoryView":837
 *         negative_step = have_step != 0 and step < 0
 * 
 *         if have_step and step == 0:             # <<<<<<<<<<<<<<
 *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
 * 
 */
    __pyx_t_1 = (__pyx_v_have_step != 0);
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_1 = ((__pyx_v_step == 0) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_2) {

      /* "View.MemoryView":838
 * 
 *         if have_step and step == 0:
 *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error)

      /* "View.MemoryView":837
 *         negative_step = have_step != 0 and step < 0
 * 
 *         if have_step and step == 0:             # <<<<<<<<<<<<<<
 *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
 * 
 */
    }

    /* "View.MemoryView":841
 * 
 * 
 *         if have_start:             # <<<<<<<<<<<<<<
 *             if start < 0:
 *                 start += shape
 */
    __pyx_t_2 = (__pyx_v_have_start != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":842
 * 
 *         if have_start:
 *             if start < 0:             # <<<<<<<<<<<<<<
 *                 start += shape
 *                 if start < 0:
 */
      __pyx_t_2 = ((__pyx_v_start < 0) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":843
 *         if have_start:
 *             if start < 0:
 *                 start += shape             # <<<<<<<<<<<<<<
 *                 if start < 0:
 *                     start = 0
 */
        __pyx_v_start = (__pyx_v_start + __pyx_v_shape);

        /* "View.MemoryView":844
 *             if start < 0:
 *                 start += shape
 *                 if start < 0:             # <<<<<<<<<<<<<<
 *                     start = 0
 *             elif start >= shape:
 */
        __pyx_t_2 = ((__pyx_v_start < 0) != 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":845
 *                 start += shape
 *                 if start < 0:
 *                     start = 0             # <<<<<<<<<<<<<<
 *             elif start >= shape:
 *                 if negative_step:
 */
          __pyx_v_start = 0;

          /* "View.MemoryView":844
 *             if start < 0:
 *                 start += shape
 *                 if start < 0:             # <<<<<<<<<<<<<<
 *                     start = 0
 *             elif start >= shape:
 */
        }

        /* "View.MemoryView":842
 * 
 *         if have_start:
 *             if start < 0:             # <<<<<<<<<<<<<<
 *                 start += shape
 *                 if start < 0:
 */
        goto __pyx_L12;
      }

      /* "View.MemoryView":846
 *                 if start < 0:
 *                     start = 0
 *             elif start >= shape:             # <<<<<<<<<<<<<<
 *                 if negative_step:
 *                     start = shape - 1
 */
      __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":847
 *                     start = 0
 *             elif start >= shape:
 *                 if negative_step:             # <<<<<<<<<<<<<<
 *                     start = shape - 1
 *                 else:
 */
        __pyx_t_2 = (__pyx_v_negative_step != 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":848
 *             elif start >= shape:
 *                 if negative_step:
 *                     start = shape - 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     start = shape
 */
          __pyx_v_start = (__pyx_v_shape - 1);

          /* "View.MemoryView":847
 *                     start = 0
 *             elif start >= shape:
 *                 if negative_step:             # <<<<<<<<<<<<<<
 *                     start = shape - 1
 *                 else:
 */
          goto __pyx_L14;
        }

        /* "View.MemoryView":850
 *                     start = shape - 1
 *                 else:
 *                     start = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
 */
        /*else*/ {
          __pyx_v_start = __pyx_v_shape;
        }
        __pyx_L14:;

        /* "View.MemoryView":846
 *                 if start < 0:
 *                     start = 0
 *             elif start >= shape:             # <<<<<<<<<<<<<<
 *                 if negative_step:
 *                     start = shape - 1
 */
      }
      __pyx_L12:;

      /* "View.MemoryView":841
 * 
 * 
 *         if have_start:             # <<<<<<<<<<<<<<
 *             if start < 0:
 *                 start += shape
 */
      goto __pyx_L11;
    }

    /* "View.MemoryView":852
 *                     start = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 start = shape - 1
 *             else:
 */
    /*else*/ {
      __pyx_t_2 = (__pyx_v_negative_step != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":853
 *         else:
 *             if negative_step:
 *                 start = shape - 1             # <<<<<<<<<<<<<<
 *             else:
 *                 start = 0
 */
        __pyx_v_start = (__pyx_v_shape - 1);

        /* "View.MemoryView":852
 *                     start = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 start = shape - 1
 *             else:
 */
        goto __pyx_L15;
      }

      /* "View.MemoryView":855
 *                 start = shape - 1
 *             else:
 *                 start = 0             # <<<<<<<<<<<<<<
 * 
 *         if have_stop:
 */
      /*else*/ {
        __pyx_v_start = 0;
      }
      __pyx_L15:;
    }
    __pyx_L11:;

    /* "View.MemoryView":857
 *                 start = 0
 * 
 *         if have_stop:             # <<<<<<<<<<<<<<
 *             if stop < 0:
 *                 stop += shape
 */
    __pyx_t_2 = (__pyx_v_have_stop != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":858
 * 
 *         if have_stop:
 *             if stop < 0:             # <<<<<<<<<<<<<<
 *                 stop += shape
 *                 if stop < 0:
 */
      __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":859
 *         if have_stop:
 *             if stop < 0:
 *                 stop += shape             # <<<<<<<<<<<<<<
 *                 if stop < 0:
 *                     stop = 0
 */
        __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);

        /* "View.MemoryView":860
 *             if stop < 0:
 *                 stop += shape
 *                 if stop < 0:             # <<<<<<<<<<<<<<
 *                     stop = 0
 *             elif stop > shape:
 */
        __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":861
 *                 stop += shape
 *                 if stop < 0:
 *                     stop = 0             # <<<<<<<<<<<<<<
 *             elif stop > shape:
 *                 stop = shape
 */
          __pyx_v_stop = 0;

          /* "View.MemoryView":860
 *             if stop < 0:
 *                 stop += shape
 *                 if stop < 0:             # <<<<<<<<<<<<<<
 *                     stop = 0
 *             elif stop > shape:
 */
        }

        /* "View.MemoryView":858
 * 
 *         if have_stop:
 *             if stop < 0:             # <<<<<<<<<<<<<<
 *                 stop += shape
 *                 if stop < 0:
 */
        goto __pyx_L17;
      }

      /* "View.MemoryView":862
 *                 if stop < 0:
 *                     stop = 0
 *             elif stop > shape:             # <<<<<<<<<<<<<<
 *                 stop = shape
 *         else:
 */
      __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":863
 *                     stop = 0
 *             elif stop > shape:
 *                 stop = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
 */
        __pyx_v_stop = __pyx_v_shape;

        /* "View.MemoryView":862
 *                 if stop < 0:
 *                     stop = 0
 *             elif stop > shape:             # <<<<<<<<<<<<<<
 *                 stop = shape
 *         else:
 */
      }
      __pyx_L17:;

      /* "View.MemoryView":857
 *                 start = 0
 * 
 *         if have_stop:             # <<<<<<<<<<<<<<
 *             if stop < 0:
 *                 stop += shape
 */
      goto __pyx_L16;
    }

    /* "View.MemoryView":865
 *                 stop = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 stop = -1
 *             else:
 */
    /*else*/ {
      __pyx_t_2 = (__pyx_v_negative_step != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":866
 *         else:
 *             if negative_step:
 *                 stop = -1             # <<<<<<<<<<<<<<
 *             else:
 *                 stop = shape
 */
        __pyx_v_stop = -1L;

        /* "View.MemoryView":865
 *                 stop = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 stop = -1
 *             else:
 */
        goto __pyx_L19;
      }

      /* "View.MemoryView":868
 *                 stop = -1
 *             else:
 *                 stop = shape             # <<<<<<<<<<<<<<
 * 
 *         if not have_step:
 */
      /*else*/ {
        __pyx_v_stop = __pyx_v_shape;
      }
      __pyx_L19:;
    }
    __pyx_L16:;

    /* "View.MemoryView":870
 *                 stop = shape
 * 
 *         if not have_step:             # <<<<<<<<<<<<<<
 *             step = 1
 * 
 */
    __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":871
 * 
 *         if not have_step:
 *             step = 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_step = 1;

      /* "View.MemoryView":870
 *                 stop = shape
 * 
 *         if not have_step:             # <<<<<<<<<<<<<<
 *             step = 1
 * 
 */
    }

    /* "View.MemoryView":875
 * 
 *         with cython.cdivision(True):
 *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
 * 
 *             if (stop - start) - step * new_shape:
 */
    __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);

    /* "View.MemoryView":877
 *             new_shape = (stop - start) // step
 * 
 *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
 *                 new_shape += 1
 * 
 */
    __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":878
 * 
 *             if (stop - start) - step * new_shape:
 *                 new_shape += 1             # <<<<<<<<<<<<<<
 * 
 *         if new_shape < 0:
 */
      __pyx_v_new_shape = (__pyx_v_new_shape + 1);

      /* "View.MemoryView":877
 *             new_shape = (stop - start) // step
 * 
 *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
 *                 new_shape += 1
 * 
 */
    }

    /* "View.MemoryView":880
 *                 new_shape += 1
 * 
 *         if new_shape < 0:             # <<<<<<<<<<<<<<
 *             new_shape = 0
 * 
 */
    __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":881
 * 
 *         if new_shape < 0:
 *             new_shape = 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_new_shape = 0;

      /* "View.MemoryView":880
 *                 new_shape += 1
 * 
 *         if new_shape < 0:             # <<<<<<<<<<<<<<
 *             new_shape = 0
 * 
 */
    }

    /* "View.MemoryView":884
 * 
 * 
 *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
 *         dst.shape[new_ndim] = new_shape
 *         dst.suboffsets[new_ndim] = suboffset
 */
    (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);

    /* "View.MemoryView":885
 * 
 *         dst.strides[new_ndim] = stride * step
 *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
 *         dst.suboffsets[new_ndim] = suboffset
 * 
 */
    (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;

    /* "View.MemoryView":886
 *         dst.strides[new_ndim] = stride * step
 *         dst.shape[new_ndim] = new_shape
 *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
  }
  __pyx_L3:;

  /* "View.MemoryView":889
 * 
 * 
 *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
 *         dst.data += start * stride
 *     else:
 */
  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":890
 * 
 *     if suboffset_dim[0] < 0:
 *         dst.data += start * stride             # <<<<<<<<<<<<<<
 *     else:
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 */
    __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));

    /* "View.MemoryView":889
 * 
 * 
 *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
 *         dst.data += start * stride
 *     else:
 */
    goto __pyx_L23;
  }

  /* "View.MemoryView":892
 *         dst.data += start * stride
 *     else:
 *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
 * 
 *     if suboffset >= 0:
 */
  /*else*/ {
    __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
    (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
  }
  __pyx_L23:;

  /* "View.MemoryView":894
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 * 
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         if not is_slice:
 *             if new_ndim == 0:
 */
  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":895
 * 
 *     if suboffset >= 0:
 *         if not is_slice:             # <<<<<<<<<<<<<<
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 */
    __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":896
 *     if suboffset >= 0:
 *         if not is_slice:
 *             if new_ndim == 0:             # <<<<<<<<<<<<<<
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 */
      __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":897
 *         if not is_slice:
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
 */
        __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);

        /* "View.MemoryView":896
 *     if suboffset >= 0:
 *         if not is_slice:
 *             if new_ndim == 0:             # <<<<<<<<<<<<<<
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 */
        goto __pyx_L26;
      }

      /* "View.MemoryView":899
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
 *                                      "must be indexed and not sliced", dim)
 *         else:
 */
      /*else*/ {

        /* "View.MemoryView":900
 *             else:
 *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
 *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
 *         else:
 *             suboffset_dim[0] = new_ndim
 */
        __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 899, __pyx_L1_error)
      }
      __pyx_L26:;

      /* "View.MemoryView":895
 * 
 *     if suboffset >= 0:
 *         if not is_slice:             # <<<<<<<<<<<<<<
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 */
      goto __pyx_L25;
    }

    /* "View.MemoryView":902
 *                                      "must be indexed and not sliced", dim)
 *         else:
 *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
 * 
 *     return 0
 */
    /*else*/ {
      (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
    }
    __pyx_L25:;

    /* "View.MemoryView":894
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 * 
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         if not is_slice:
 *             if new_ndim == 0:
 */
  }

  /* "View.MemoryView":904
 *             suboffset_dim[0] = new_ndim
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":807
 * 
 * @cname('__pyx_memoryview_slice_memviewslice')
 * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
 *         __Pyx_memviewslice *dst,
 *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":910
 * 
 * @cname('__pyx_pybuffer_index')
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 */

static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
  Py_ssize_t __pyx_v_shape;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_suboffset;
  Py_ssize_t __pyx_v_itemsize;
  char *__pyx_v_resultp;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pybuffer_index", 0);

  /* "View.MemoryView":912
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t itemsize = view.itemsize
 *     cdef char *resultp
 */
  __pyx_v_suboffset = -1L;

  /* "View.MemoryView":913
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
 *     cdef char *resultp
 * 
 */
  __pyx_t_1 = __pyx_v_view->itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":916
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len / itemsize
 *         stride = itemsize
 */
  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":917
 * 
 *     if view.ndim == 0:
 *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
 *         stride = itemsize
 *     else:
 */
    if (unlikely(__pyx_v_itemsize == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(2, 917, __pyx_L1_error)
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(2, 917, __pyx_L1_error)
    }
    __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);

    /* "View.MemoryView":918
 *     if view.ndim == 0:
 *         shape = view.len / itemsize
 *         stride = itemsize             # <<<<<<<<<<<<<<
 *     else:
 *         shape = view.shape[dim]
 */
    __pyx_v_stride = __pyx_v_itemsize;

    /* "View.MemoryView":916
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len / itemsize
 *         stride = itemsize
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":920
 *         stride = itemsize
 *     else:
 *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
 */
  /*else*/ {
    __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);

    /* "View.MemoryView":921
 *     else:
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]
 */
    __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);

    /* "View.MemoryView":922
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
 */
    __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":923
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
 * 
 *     if index < 0:
 */
      __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);

      /* "View.MemoryView":922
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
 */
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":925
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
 */
  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":926
 * 
 *     if index < 0:
 *         index += view.shape[dim]             # <<<<<<<<<<<<<<
 *         if index < 0:
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 */
    __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));

    /* "View.MemoryView":927
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 */
    __pyx_t_2 = ((__pyx_v_index < 0) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "View.MemoryView":928
 *         index += view.shape[dim]
 *         if index < 0:
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
 * 
 *     if index >= shape:
 */
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 928, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(2, 928, __pyx_L1_error)

      /* "View.MemoryView":927
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 */
    }

    /* "View.MemoryView":925
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
 */
  }

  /* "View.MemoryView":930
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 *     if index >= shape:             # <<<<<<<<<<<<<<
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 */
  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "View.MemoryView":931
 * 
 *     if index >= shape:
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
 * 
 *     resultp = bufp + index * stride
 */
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 931, __pyx_L1_error)

    /* "View.MemoryView":930
 *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 *     if index >= shape:             # <<<<<<<<<<<<<<
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 */
  }

  /* "View.MemoryView":933
 *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
 * 
 *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset
 */
  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));

  /* "View.MemoryView":934
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 */
  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":935
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
 * 
 *     return resultp
 */
    __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);

    /* "View.MemoryView":934
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 */
  }

  /* "View.MemoryView":937
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 *     return resultp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_resultp;
  goto __pyx_L0;

  /* "View.MemoryView":910
 * 
 * @cname('__pyx_pybuffer_index')
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":943
 * 
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 */

static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
  int __pyx_v_ndim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":944
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
 *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
 */
  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
  __pyx_v_ndim = __pyx_t_1;

  /* "View.MemoryView":946
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t *strides = memslice.strides
 * 
 */
  __pyx_t_2 = __pyx_v_memslice->shape;
  __pyx_v_shape = __pyx_t_2;

  /* "View.MemoryView":947
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
 *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_v_memslice->strides;
  __pyx_v_strides = __pyx_t_2;

  /* "View.MemoryView":951
 * 
 *     cdef int i, j
 *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
 */
  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":952
 *     cdef int i, j
 *     for i in range(ndim / 2):
 *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]
 */
    __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);

    /* "View.MemoryView":953
 *     for i in range(ndim / 2):
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 */
    __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
    __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
    (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
    (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;

    /* "View.MemoryView":954
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 */
    __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
    __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
    (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
    (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;

    /* "View.MemoryView":956
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 */
    __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
    __pyx_t_7 = __pyx_t_8;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_7) {

      /* "View.MemoryView":957
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
 * 
 *     return 1
 */
      __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error)

      /* "View.MemoryView":956
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 */
    }
  }

  /* "View.MemoryView":959
 *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 *     return 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "View.MemoryView":943
 * 
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":976
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 */

/* Python wrapper */
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "View.MemoryView":977
 * 
 *     def __dealloc__(self):
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 */
  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);

  /* "View.MemoryView":976
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":979
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
 */

static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_item_to_object", 0);

  /* "View.MemoryView":980
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":981
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":980
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
 */
  }

  /* "View.MemoryView":983
 *             return self.to_object_func(itemp)
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":979
 *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":985
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
 */

static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":986
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
 *             self.to_dtype_func(itemp, value)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":987
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)
 */
    __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error)

    /* "View.MemoryView":986
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
 *             self.to_dtype_func(itemp, value)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":989
 *             self.to_dtype_func(itemp, value)
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":985
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":992
 * 
 *     @property
 *     def base(self):             # <<<<<<<<<<<<<<
 *         return self.from_object
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "View.MemoryView":993
 *     @property
 *     def base(self):
 *         return self.from_object             # <<<<<<<<<<<<<<
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->from_object);
  __pyx_r = __pyx_v_self->from_object;
  goto __pyx_L0;

  /* "View.MemoryView":992
 * 
 *     @property
 *     def base(self):             # <<<<<<<<<<<<<<
 *         return self.from_object
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":999
 * 
 * @cname('__pyx_memoryview_fromslice')
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
 *                           int ndim,
 *                           object (*to_object_func)(char *),
 */

static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_suboffset;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_TypeInfo *__pyx_t_4;
  Py_buffer __pyx_t_5;
  Py_ssize_t *__pyx_t_6;
  Py_ssize_t *__pyx_t_7;
  Py_ssize_t *__pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);

  /* "View.MemoryView":1007
 *     cdef _memoryviewslice result
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1008
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "View.MemoryView":1007
 *     cdef _memoryviewslice result
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  }

  /* "View.MemoryView":1013
 * 
 * 
 *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     result.from_slice = memviewslice
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "View.MemoryView":1015
 *     result = _memoryviewslice(None, 0, dtype_is_object)
 * 
 *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 */
  __pyx_v_result->from_slice = __pyx_v_memviewslice;

  /* "View.MemoryView":1016
 * 
 *     result.from_slice = memviewslice
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
 * 
 *     result.from_object = (<memoryview> memviewslice.memview).base
 */
  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);

  /* "View.MemoryView":1018
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->from_object);
  __Pyx_DECREF(__pyx_v_result->from_object);
  __pyx_v_result->from_object = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "View.MemoryView":1019
 * 
 *     result.from_object = (<memoryview> memviewslice.memview).base
 *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
 * 
 *     result.view = memviewslice.memview.view
 */
  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;

  /* "View.MemoryView":1021
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
 */
  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
  __pyx_v_result->__pyx_base.view = __pyx_t_5;

  /* "View.MemoryView":1022
 * 
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 */
  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);

  /* "View.MemoryView":1023
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)
 */
  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;

  /* "View.MemoryView":1024
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
 *     Py_INCREF(Py_None)
 * 
 */
  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;

  /* "View.MemoryView":1025
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
 */
  Py_INCREF(Py_None);

  /* "View.MemoryView":1027
 *     Py_INCREF(Py_None)
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *         result.flags = PyBUF_RECORDS
 *     else:
 */
  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1028
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
 *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
 *     else:
 *         result.flags = PyBUF_RECORDS_RO
 */
    __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;

    /* "View.MemoryView":1027
 *     Py_INCREF(Py_None)
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *         result.flags = PyBUF_RECORDS
 *     else:
 */
    goto __pyx_L4;
  }

  /* "View.MemoryView":1030
 *         result.flags = PyBUF_RECORDS
 *     else:
 *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 */
  /*else*/ {
    __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
  }
  __pyx_L4:;

  /* "View.MemoryView":1032
 *         result.flags = PyBUF_RECORDS_RO
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
 * 
 */
  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);

  /* "View.MemoryView":1033
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);

  /* "View.MemoryView":1036
 * 
 * 
 *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
 */
  __pyx_v_result->__pyx_base.view.suboffsets = NULL;

  /* "View.MemoryView":1037
 * 
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 */
  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
    __pyx_t_6 = __pyx_t_8;
    __pyx_v_suboffset = (__pyx_t_6[0]);

    /* "View.MemoryView":1038
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
 */
    __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":1039
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);

      /* "View.MemoryView":1040
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break             # <<<<<<<<<<<<<<
 * 
 *     result.view.len = result.view.itemsize
 */
      goto __pyx_L6_break;

      /* "View.MemoryView":1038
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
 */
    }
  }
  __pyx_L6_break:;

  /* "View.MemoryView":1042
 *             break
 * 
 *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
 *     for length in result.view.shape[:ndim]:
 *         result.view.len *= length
 */
  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;

  /* "View.MemoryView":1043
 * 
 *     result.view.len = result.view.itemsize
 *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
 *         result.view.len *= length
 * 
 */
  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
    __pyx_t_6 = __pyx_t_8;
    __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":1044
 *     result.view.len = result.view.itemsize
 *     for length in result.view.shape[:ndim]:
 *         result.view.len *= length             # <<<<<<<<<<<<<<
 * 
 *     result.to_object_func = to_object_func
 */
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
  }

  /* "View.MemoryView":1046
 *         result.view.len *= length
 * 
 *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
 *     result.to_dtype_func = to_dtype_func
 * 
 */
  __pyx_v_result->to_object_func = __pyx_v_to_object_func;

  /* "View.MemoryView":1047
 * 
 *     result.to_object_func = to_object_func
 *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;

  /* "View.MemoryView":1049
 *     result.to_dtype_func = to_dtype_func
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":999
 * 
 * @cname('__pyx_memoryview_fromslice')
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
 *                           int ndim,
 *                           object (*to_object_func)(char *),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1052
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 */

static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
  __Pyx_memviewslice *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);

  /* "View.MemoryView":1055
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1056
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview             # <<<<<<<<<<<<<<
 *         return &obj.from_slice
 *     else:
 */
    if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":1057
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview
 *         return &obj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, mslice)
 */
    __pyx_r = (&__pyx_v_obj->from_slice);
    goto __pyx_L0;

    /* "View.MemoryView":1055
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
 */
  }

  /* "View.MemoryView":1059
 *         return &obj.from_slice
 *     else:
 *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
 *         return mslice
 * 
 */
  /*else*/ {
    __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);

    /* "View.MemoryView":1060
 *     else:
 *         slice_copy(memview, mslice)
 *         return mslice             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_slice_copy')
 */
    __pyx_r = __pyx_v_mslice;
    goto __pyx_L0;
  }

  /* "View.MemoryView":1052
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1063
 * 
 * @cname('__pyx_memoryview_slice_copy')
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
 *     cdef int dim
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 */

static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
  int __pyx_v_dim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  Py_ssize_t *__pyx_v_suboffsets;
  __Pyx_RefNannyDeclarations
  Py_ssize_t *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("slice_copy", 0);

  /* "View.MemoryView":1067
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 * 
 *     shape = memview.view.shape             # <<<<<<<<<<<<<<
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets
 */
  __pyx_t_1 = __pyx_v_memview->view.shape;
  __pyx_v_shape = __pyx_t_1;

  /* "View.MemoryView":1068
 * 
 *     shape = memview.view.shape
 *     strides = memview.view.strides             # <<<<<<<<<<<<<<
 *     suboffsets = memview.view.suboffsets
 * 
 */
  __pyx_t_1 = __pyx_v_memview->view.strides;
  __pyx_v_strides = __pyx_t_1;

  /* "View.MemoryView":1069
 *     shape = memview.view.shape
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 */
  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
  __pyx_v_suboffsets = __pyx_t_1;

  /* "View.MemoryView":1071
 *     suboffsets = memview.view.suboffsets
 * 
 *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
 *     dst.data = <char *> memview.view.buf
 * 
 */
  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);

  /* "View.MemoryView":1072
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
 * 
 *     for dim in range(memview.view.ndim):
 */
  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);

  /* "View.MemoryView":1074
 *     dst.data = <char *> memview.view.buf
 * 
 *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 */
  __pyx_t_2 = __pyx_v_memview->view.ndim;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_dim = __pyx_t_4;

    /* "View.MemoryView":1075
 * 
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
 *         dst.strides[dim] = strides[dim]
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 */
    (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);

    /* "View.MemoryView":1076
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 * 
 */
    (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);

    /* "View.MemoryView":1077
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object')
 */
    if ((__pyx_v_suboffsets != 0)) {
      __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
    } else {
      __pyx_t_5 = -1L;
    }
    (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
  }

  /* "View.MemoryView":1063
 * 
 * @cname('__pyx_memoryview_slice_copy')
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
 *     cdef int dim
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":1080
 * 
 * @cname('__pyx_memoryview_copy_object')
 * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 */

static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
  __Pyx_memviewslice __pyx_v_memviewslice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_copy", 0);

  /* "View.MemoryView":1083
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
 */
  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));

  /* "View.MemoryView":1084
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)
 *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1080
 * 
 * @cname('__pyx_memoryview_copy_object')
 * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1087
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
 *     """
 *     Create a new memoryview object from a given memoryview object and slice.
 */

static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
  PyObject *(*__pyx_v_to_object_func)(char *);
  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *(*__pyx_t_3)(char *);
  int (*__pyx_t_4)(char *, PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);

  /* "View.MemoryView":1094
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1095
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
 */
    __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
    __pyx_v_to_object_func = __pyx_t_3;

    /* "View.MemoryView":1096
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
 *     else:
 *         to_object_func = NULL
 */
    __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
    __pyx_v_to_dtype_func = __pyx_t_4;

    /* "View.MemoryView":1094
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1098
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
 *         to_object_func = NULL             # <<<<<<<<<<<<<<
 *         to_dtype_func = NULL
 * 
 */
  /*else*/ {
    __pyx_v_to_object_func = NULL;

    /* "View.MemoryView":1099
 *     else:
 *         to_object_func = NULL
 *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
 */
    __pyx_v_to_dtype_func = NULL;
  }
  __pyx_L3:;

  /* "View.MemoryView":1101
 *         to_dtype_func = NULL
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "View.MemoryView":1103
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1087
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
 *     """
 *     Create a new memoryview object from a given memoryview object and slice.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1109
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
 *     if arg < 0:
 *         return -arg
 */

static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
  Py_ssize_t __pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":1110
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
 *     if arg < 0:             # <<<<<<<<<<<<<<
 *         return -arg
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1111
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
 *     if arg < 0:
 *         return -arg             # <<<<<<<<<<<<<<
 *     else:
 *         return arg
 */
    __pyx_r = (-__pyx_v_arg);
    goto __pyx_L0;

    /* "View.MemoryView":1110
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
 *     if arg < 0:             # <<<<<<<<<<<<<<
 *         return -arg
 *     else:
 */
  }

  /* "View.MemoryView":1113
 *         return -arg
 *     else:
 *         return arg             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_get_best_slice_order')
 */
  /*else*/ {
    __pyx_r = __pyx_v_arg;
    goto __pyx_L0;
  }

  /* "View.MemoryView":1109
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
 *     if arg < 0:
 *         return -arg
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1116
 * 
 * @cname('__pyx_get_best_slice_order')
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Figure out the best memory access order for a given slice.
 */

static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_c_stride;
  Py_ssize_t __pyx_v_f_stride;
  char __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "View.MemoryView":1121
 *     """
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t f_stride = 0
 * 
 */
  __pyx_v_c_stride = 0;

  /* "View.MemoryView":1122
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0
 *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
 */
  __pyx_v_f_stride = 0;

  /* "View.MemoryView":1124
 *     cdef Py_ssize_t f_stride = 0
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 */
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1125
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
 */
    __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1126
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1127
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
      goto __pyx_L4_break;

      /* "View.MemoryView":1125
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
 */
    }
  }
  __pyx_L4_break:;

  /* "View.MemoryView":1129
 *             break
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
 */
  __pyx_t_1 = __pyx_v_ndim;
  __pyx_t_3 = __pyx_t_1;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "View.MemoryView":1130
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
 */
    __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1131
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1132
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
 */
      goto __pyx_L7_break;

      /* "View.MemoryView":1130
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
 */
    }
  }
  __pyx_L7_break:;

  /* "View.MemoryView":1134
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
 */
  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1135
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
 *         return 'C'             # <<<<<<<<<<<<<<
 *     else:
 *         return 'F'
 */
    __pyx_r = 'C';
    goto __pyx_L0;

    /* "View.MemoryView":1134
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
 */
  }

  /* "View.MemoryView":1137
 *         return 'C'
 *     else:
 *         return 'F'             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
  /*else*/ {
    __pyx_r = 'F';
    goto __pyx_L0;
  }

  /* "View.MemoryView":1116
 * 
 * @cname('__pyx_get_best_slice_order')
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Figure out the best memory access order for a given slice.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1140
 * 
 * @cython.cdivision(True)
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
 *                                    char *dst_data, Py_ssize_t *dst_strides,
 *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
 */

static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
  Py_ssize_t __pyx_v_dst_extent;
  Py_ssize_t __pyx_v_src_stride;
  Py_ssize_t __pyx_v_dst_stride;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;

  /* "View.MemoryView":1147
 * 
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
 */
  __pyx_v_src_extent = (__pyx_v_src_shape[0]);

  /* "View.MemoryView":1148
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 */
  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);

  /* "View.MemoryView":1149
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 */
  __pyx_v_src_stride = (__pyx_v_src_strides[0]);

  /* "View.MemoryView":1150
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
 */
  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);

  /* "View.MemoryView":1152
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 */
  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1153
 * 
 *     if ndim == 1:
 *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 */
    __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }

    /* "View.MemoryView":1154
 *     if ndim == 1:
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 *        else:
 */
    __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
    if (__pyx_t_2) {
      __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
    }
    __pyx_t_3 = (__pyx_t_2 != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L5_bool_binop_done:;

    /* "View.MemoryView":1153
 * 
 *     if ndim == 1:
 *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 */
    if (__pyx_t_1) {

      /* "View.MemoryView":1155
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
 *        else:
 *            for i in range(dst_extent):
 */
      (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));

      /* "View.MemoryView":1153
 * 
 *     if ndim == 1:
 *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 */
      goto __pyx_L4;
    }

    /* "View.MemoryView":1157
 *            memcpy(dst_data, src_data, itemsize * dst_extent)
 *        else:
 *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *                memcpy(dst_data, src_data, itemsize)
 *                src_data += src_stride
 */
    /*else*/ {
      __pyx_t_4 = __pyx_v_dst_extent;
      __pyx_t_5 = __pyx_t_4;
      for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
        __pyx_v_i = __pyx_t_6;

        /* "View.MemoryView":1158
 *        else:
 *            for i in range(dst_extent):
 *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
 *                src_data += src_stride
 *                dst_data += dst_stride
 */
        (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));

        /* "View.MemoryView":1159
 *            for i in range(dst_extent):
 *                memcpy(dst_data, src_data, itemsize)
 *                src_data += src_stride             # <<<<<<<<<<<<<<
 *                dst_data += dst_stride
 *     else:
 */
        __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

        /* "View.MemoryView":1160
 *                memcpy(dst_data, src_data, itemsize)
 *                src_data += src_stride
 *                dst_data += dst_stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(dst_extent):
 */
        __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
      }
    }
    __pyx_L4:;

    /* "View.MemoryView":1152
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *        if (src_stride > 0 and dst_stride > 0 and
 *            <size_t> src_stride == itemsize == <size_t> dst_stride):
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1162
 *                dst_data += dst_stride
 *     else:
 *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *             _copy_strided_to_strided(src_data, src_strides + 1,
 *                                      dst_data, dst_strides + 1,
 */
  /*else*/ {
    __pyx_t_4 = __pyx_v_dst_extent;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "View.MemoryView":1163
 *     else:
 *         for i in range(dst_extent):
 *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
 *                                      dst_data, dst_strides + 1,
 *                                      src_shape + 1, dst_shape + 1,
 */
      _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);

      /* "View.MemoryView":1167
 *                                      src_shape + 1, dst_shape + 1,
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride             # <<<<<<<<<<<<<<
 *             dst_data += dst_stride
 * 
 */
      __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

      /* "View.MemoryView":1168
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride
 *             dst_data += dst_stride             # <<<<<<<<<<<<<<
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
 */
      __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1140
 * 
 * @cython.cdivision(True)
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
 *                                    char *dst_data, Py_ssize_t *dst_strides,
 *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
 */

  /* function exit code */
}

/* "View.MemoryView":1170
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) nogil:
 */

static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {

  /* "View.MemoryView":1173
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) nogil:
 *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
 *                              src.shape, dst.shape, ndim, itemsize)
 * 
 */
  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1170
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1177
 * 
 * @cname('__pyx_memoryview_slice_get_size')
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
 */

static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_shape;
  Py_ssize_t __pyx_v_size;
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;

  /* "View.MemoryView":1179
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef Py_ssize_t shape, size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     for shape in src.shape[:ndim]:
 */
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_size = __pyx_t_1;

  /* "View.MemoryView":1181
 *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
 * 
 *     for shape in src.shape[:ndim]:             # <<<<<<<<<<<<<<
 *         size *= shape
 * 
 */
  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_v_shape = (__pyx_t_2[0]);

    /* "View.MemoryView":1182
 * 
 *     for shape in src.shape[:ndim]:
 *         size *= shape             # <<<<<<<<<<<<<<
 * 
 *     return size
 */
    __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
  }

  /* "View.MemoryView":1184
 *         size *= shape
 * 
 *     return size             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_fill_contig_strides_array')
 */
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "View.MemoryView":1177
 * 
 * @cname('__pyx_memoryview_slice_get_size')
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1187
 * 
 * @cname('__pyx_fill_contig_strides_array')
 * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
 *                 int ndim, char order) nogil:
 */

static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "View.MemoryView":1196
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
 */
  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1197
 * 
 *     if order == 'F':
 *         for idx in range(ndim):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride *= shape[idx]
 */
    __pyx_t_2 = __pyx_v_ndim;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_idx = __pyx_t_4;

      /* "View.MemoryView":1198
 *     if order == 'F':
 *         for idx in range(ndim):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride *= shape[idx]
 *     else:
 */
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1199
 *         for idx in range(ndim):
 *             strides[idx] = stride
 *             stride *= shape[idx]             # <<<<<<<<<<<<<<
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
 */
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }

    /* "View.MemoryView":1196
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1201
 *             stride *= shape[idx]
 *     else:
 *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride *= shape[idx]
 */
  /*else*/ {
    for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
      __pyx_v_idx = __pyx_t_2;

      /* "View.MemoryView":1202
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride *= shape[idx]
 * 
 */
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1203
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride
 *             stride *= shape[idx]             # <<<<<<<<<<<<<<
 * 
 *     return stride
 */
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1205
 *             stride *= shape[idx]
 * 
 *     return stride             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 */
  __pyx_r = __pyx_v_stride;
  goto __pyx_L0;

  /* "View.MemoryView":1187
 * 
 * @cname('__pyx_fill_contig_strides_array')
 * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
 *                 int ndim, char order) nogil:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1208
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                              __Pyx_memviewslice *tmpslice,
 *                              char order,
 */

static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
  int __pyx_v_i;
  void *__pyx_v_result;
  size_t __pyx_v_itemsize;
  size_t __pyx_v_size;
  void *__pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_memoryview_obj *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":1219
 *     cdef void *result
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
 */
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1220
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
 * 
 *     result = malloc(size)
 */
  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);

  /* "View.MemoryView":1222
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
 *     result = malloc(size)             # <<<<<<<<<<<<<<
 *     if not result:
 *         _err(MemoryError, NULL)
 */
  __pyx_v_result = malloc(__pyx_v_size);

  /* "View.MemoryView":1223
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err(MemoryError, NULL)
 * 
 */
  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1224
 *     result = malloc(size)
 *     if not result:
 *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error)

    /* "View.MemoryView":1223
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err(MemoryError, NULL)
 * 
 */
  }

  /* "View.MemoryView":1227
 * 
 * 
 *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 */
  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);

  /* "View.MemoryView":1228
 * 
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
 */
  __pyx_t_4 = __pyx_v_src->memview;
  __pyx_v_tmpslice->memview = __pyx_t_4;

  /* "View.MemoryView":1229
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1
 */
  __pyx_t_3 = __pyx_v_ndim;
  __pyx_t_5 = __pyx_t_3;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "View.MemoryView":1230
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
 *         tmpslice.suboffsets[i] = -1
 * 
 */
    (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);

    /* "View.MemoryView":1231
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
 */
    (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
  }

  /* "View.MemoryView":1233
 *         tmpslice.suboffsets[i] = -1
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
 *                               ndim, order)
 * 
 */
  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));

  /* "View.MemoryView":1237
 * 
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0
 */
  __pyx_t_3 = __pyx_v_ndim;
  __pyx_t_5 = __pyx_t_3;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "View.MemoryView":1238
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
 */
    __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1239
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
 * 
 *     if slice_is_contig(src[0], order, ndim):
 */
      (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;

      /* "View.MemoryView":1238
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
 */
    }
  }

  /* "View.MemoryView":1241
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
 */
  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1242
 * 
 *     if slice_is_contig(src[0], order, ndim):
 *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 */
    (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));

    /* "View.MemoryView":1241
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
 */
    goto __pyx_L9;
  }

  /* "View.MemoryView":1244
 *         memcpy(result, src.data, size)
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  /*else*/ {
    copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
  }
  __pyx_L9:;

  /* "View.MemoryView":1246
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":1208
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                              __Pyx_memviewslice *tmpslice,
 *                              char order,
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1251
 * 
 * @cname('__pyx_memoryview_err_extents')
 * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
 */

static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err_extents", 0);

  /* "View.MemoryView":1254
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
 *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err_dim')
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;

  /* "View.MemoryView":1253
 * cdef int _err_extents(int i, Py_ssize_t extent1,
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
 *                                                         (i, extent1, extent2))
 * 
 */
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __PYX_ERR(2, 1253, __pyx_L1_error)

  /* "View.MemoryView":1251
 * 
 * @cname('__pyx_memoryview_err_extents')
 * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1257
 * 
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise error(msg.decode('ascii') % dim)
 * 
 */

static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err_dim", 0);
  __Pyx_INCREF(__pyx_v_error);

  /* "View.MemoryView":1258
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
 *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err')
 */
  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_v_error);
  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(2, 1258, __pyx_L1_error)

  /* "View.MemoryView":1257
 * 
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise error(msg.decode('ascii') % dim)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1261
 * 
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
 *     if msg != NULL:
 *         raise error(msg.decode('ascii'))
 */

static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err", 0);
  __Pyx_INCREF(__pyx_v_error);

  /* "View.MemoryView":1262
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:
 *     if msg != NULL:             # <<<<<<<<<<<<<<
 *         raise error(msg.decode('ascii'))
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":1263
 * cdef int _err(object error, char *msg) except -1 with gil:
 *     if msg != NULL:
 *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
 *     else:
 *         raise error
 */
    __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_error);
    __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(2, 1263, __pyx_L1_error)

    /* "View.MemoryView":1262
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:
 *     if msg != NULL:             # <<<<<<<<<<<<<<
 *         raise error(msg.decode('ascii'))
 *     else:
 */
  }

  /* "View.MemoryView":1265
 *         raise error(msg.decode('ascii'))
 *     else:
 *         raise error             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_contents')
 */
  /*else*/ {
    __Pyx_Raise(__pyx_v_error, 0, 0, 0);
    __PYX_ERR(2, 1265, __pyx_L1_error)
  }

  /* "View.MemoryView":1261
 * 
 * @cname('__pyx_memoryview_err')
 * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
 *     if msg != NULL:
 *         raise error(msg.decode('ascii'))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_error);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1268
 * 
 * @cname('__pyx_memoryview_copy_contents')
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice dst,
 *                                   int src_ndim, int dst_ndim,
 */

static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
  void *__pyx_v_tmpdata;
  size_t __pyx_v_itemsize;
  int __pyx_v_i;
  char __pyx_v_order;
  int __pyx_v_broadcasting;
  int __pyx_v_direct_copy;
  __Pyx_memviewslice __pyx_v_tmp;
  int __pyx_v_ndim;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  void *__pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":1276
 *     Check for overlapping memory and verify the shapes.
 *     """
 *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
 */
  __pyx_v_tmpdata = NULL;

  /* "View.MemoryView":1277
 *     """
 *     cdef void *tmpdata = NULL
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
 */
  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1279
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False
 */
  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);

  /* "View.MemoryView":1280
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
 *     cdef bint direct_copy = False
 *     cdef __Pyx_memviewslice tmp
 */
  __pyx_v_broadcasting = 0;

  /* "View.MemoryView":1281
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
 *     cdef __Pyx_memviewslice tmp
 * 
 */
  __pyx_v_direct_copy = 0;

  /* "View.MemoryView":1284
 *     cdef __Pyx_memviewslice tmp
 * 
 *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 */
  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1285
 * 
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 */
    __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);

    /* "View.MemoryView":1284
 *     cdef __Pyx_memviewslice tmp
 * 
 *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1286
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 */
  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1287
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)
 */
    __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);

    /* "View.MemoryView":1286
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 */
  }
  __pyx_L3:;

  /* "View.MemoryView":1289
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
  __pyx_t_3 = __pyx_v_dst_ndim;
  __pyx_t_4 = __pyx_v_src_ndim;
  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  __pyx_v_ndim = __pyx_t_5;

  /* "View.MemoryView":1291
 *     cdef int ndim = max(src_ndim, dst_ndim)
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
 */
  __pyx_t_5 = __pyx_v_ndim;
  __pyx_t_3 = __pyx_t_5;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "View.MemoryView":1292
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 */
    __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1293
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
 *                 broadcasting = True
 *                 src.strides[i] = 0
 */
      __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":1294
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
 *                 broadcasting = True             # <<<<<<<<<<<<<<
 *                 src.strides[i] = 0
 *             else:
 */
        __pyx_v_broadcasting = 1;

        /* "View.MemoryView":1295
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 */
        (__pyx_v_src.strides[__pyx_v_i]) = 0;

        /* "View.MemoryView":1293
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
 *                 broadcasting = True
 *                 src.strides[i] = 0
 */
        goto __pyx_L7;
      }

      /* "View.MemoryView":1297
 *                 src.strides[i] = 0
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
 * 
 *         if src.suboffsets[i] >= 0:
 */
      /*else*/ {
        __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error)
      }
      __pyx_L7:;

      /* "View.MemoryView":1292
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 */
    }

    /* "View.MemoryView":1299
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 * 
 *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             _err_dim(ValueError, "Dimension %d is not direct", i)
 * 
 */
    __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1300
 * 
 *         if src.suboffsets[i] >= 0:
 *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 */
      __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error)

      /* "View.MemoryView":1299
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 * 
 *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             _err_dim(ValueError, "Dimension %d is not direct", i)
 * 
 */
    }
  }

  /* "View.MemoryView":1302
 *             _err_dim(ValueError, "Dimension %d is not direct", i)
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
 * 
 *         if not slice_is_contig(src, order, ndim):
 */
  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1304
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
 */
    __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1305
 * 
 *         if not slice_is_contig(src, order, ndim):
 *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 */
      __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);

      /* "View.MemoryView":1304
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
 */
    }

    /* "View.MemoryView":1307
 *             order = get_best_order(&dst, ndim)
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
 *         src = tmp
 * 
 */
    __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error)
    __pyx_v_tmpdata = __pyx_t_7;

    /* "View.MemoryView":1308
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 *         src = tmp             # <<<<<<<<<<<<<<
 * 
 *     if not broadcasting:
 */
    __pyx_v_src = __pyx_v_tmp;

    /* "View.MemoryView":1302
 *             _err_dim(ValueError, "Dimension %d is not direct", i)
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
 * 
 *         if not slice_is_contig(src, order, ndim):
 */
  }

  /* "View.MemoryView":1310
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":1313
 * 
 * 
 *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
 */
    __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1314
 * 
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
 *         elif slice_is_contig(src, 'F', ndim):
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 */
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);

      /* "View.MemoryView":1313
 * 
 * 
 *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
 */
      goto __pyx_L12;
    }

    /* "View.MemoryView":1315
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 */
    __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1316
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
 *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
 * 
 *         if direct_copy:
 */
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);

      /* "View.MemoryView":1315
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 */
    }
    __pyx_L12:;

    /* "View.MemoryView":1318
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 */
    __pyx_t_2 = (__pyx_v_direct_copy != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1320
 *         if direct_copy:
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 */
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

      /* "View.MemoryView":1321
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 *             free(tmpdata)
 */
      (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));

      /* "View.MemoryView":1322
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
 *             free(tmpdata)
 *             return 0
 */
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

      /* "View.MemoryView":1323
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 *             free(tmpdata)             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
      free(__pyx_v_tmpdata);

      /* "View.MemoryView":1324
 *             refcount_copying(&dst, dtype_is_object, ndim, True)
 *             free(tmpdata)
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "View.MemoryView":1318
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, False)
 */
    }

    /* "View.MemoryView":1310
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  }

  /* "View.MemoryView":1326
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (__pyx_v_order == 'F');
  if (__pyx_t_2) {
    __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
  }
  __pyx_t_8 = (__pyx_t_2 != 0);
  if (__pyx_t_8) {

    /* "View.MemoryView":1329
 * 
 * 
 *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&dst)
 * 
 */
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error)

    /* "View.MemoryView":1330
 * 
 *         transpose_memslice(&src)
 *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, False)
 */
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error)

    /* "View.MemoryView":1326
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
 */
  }

  /* "View.MemoryView":1332
 *         transpose_memslice(&dst)
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 */
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1333
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 * 
 */
  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1334
 *     refcount_copying(&dst, dtype_is_object, ndim, False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
 * 
 *     free(tmpdata)
 */
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1336
 *     refcount_copying(&dst, dtype_is_object, ndim, True)
 * 
 *     free(tmpdata)             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  free(__pyx_v_tmpdata);

  /* "View.MemoryView":1337
 * 
 *     free(tmpdata)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1268
 * 
 * @cname('__pyx_memoryview_copy_contents')
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice dst,
 *                                   int src_ndim, int dst_ndim,
 */

  /* function exit code */
  __pyx_L1_error:;
  {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
    #endif
    __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
    #ifdef WITH_THREAD
    __Pyx_PyGILState_Release(__pyx_gilstate_save);
    #endif
  }
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1340
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
 *                             int ndim,
 *                             int ndim_other) nogil:
 */

static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
  int __pyx_v_i;
  int __pyx_v_offset;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1344
 *                             int ndim_other) nogil:
 *     cdef int i
 *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
 */
  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);

  /* "View.MemoryView":1346
 *     cdef int offset = ndim_other - ndim
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]
 */
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1347
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
 *         mslice.strides[i + offset] = mslice.strides[i]
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 */
    (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);

    /* "View.MemoryView":1348
 *     for i in range(ndim - 1, -1, -1):
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 * 
 */
    (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);

    /* "View.MemoryView":1349
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
 * 
 *     for i in range(offset):
 */
    (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
  }

  /* "View.MemoryView":1351
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 * 
 *     for i in range(offset):             # <<<<<<<<<<<<<<
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]
 */
  __pyx_t_1 = __pyx_v_offset;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1352
 * 
 *     for i in range(offset):
 *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1
 */
    (__pyx_v_mslice->shape[__pyx_v_i]) = 1;

    /* "View.MemoryView":1353
 *     for i in range(offset):
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
 *         mslice.suboffsets[i] = -1
 * 
 */
    (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);

    /* "View.MemoryView":1354
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
  }

  /* "View.MemoryView":1340
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
 *                             int ndim,
 *                             int ndim_other) nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1362
 * 
 * @cname('__pyx_memoryview_refcount_copying')
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
 *                            int ndim, bint inc) nogil:
 * 
 */

static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
  int __pyx_t_1;

  /* "View.MemoryView":1366
 * 
 * 
 *     if dtype_is_object:             # <<<<<<<<<<<<<<
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
 *                                            dst.strides, ndim, inc)
 */
  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1367
 * 
 *     if dtype_is_object:
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
 *                                            dst.strides, ndim, inc)
 * 
 */
    __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);

    /* "View.MemoryView":1366
 * 
 * 
 *     if dtype_is_object:             # <<<<<<<<<<<<<<
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
 *                                            dst.strides, ndim, inc)
 */
  }

  /* "View.MemoryView":1362
 * 
 * @cname('__pyx_memoryview_refcount_copying')
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
 *                            int ndim, bint inc) nogil:
 * 
 */

  /* function exit code */
}

/* "View.MemoryView":1371
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) with gil:
 */

static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);

  /* "View.MemoryView":1374
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) with gil:
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 */
  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);

  /* "View.MemoryView":1371
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) with gil:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "View.MemoryView":1377
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                     Py_ssize_t *strides, int ndim, bint inc):
 *     cdef Py_ssize_t i
 */

static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);

  /* "View.MemoryView":1381
 *     cdef Py_ssize_t i
 * 
 *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
 *         if ndim == 1:
 *             if inc:
 */
  __pyx_t_1 = (__pyx_v_shape[0]);
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1382
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
 */
    __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
    if (__pyx_t_4) {

      /* "View.MemoryView":1383
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 */
      __pyx_t_4 = (__pyx_v_inc != 0);
      if (__pyx_t_4) {

        /* "View.MemoryView":1384
 *         if ndim == 1:
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])
 */
        Py_INCREF((((PyObject **)__pyx_v_data)[0]));

        /* "View.MemoryView":1383
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 */
        goto __pyx_L6;
      }

      /* "View.MemoryView":1386
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1,
 */
      /*else*/ {
        Py_DECREF((((PyObject **)__pyx_v_data)[0]));
      }
      __pyx_L6:;

      /* "View.MemoryView":1382
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
 */
      goto __pyx_L5;
    }

    /* "View.MemoryView":1388
 *                 Py_DECREF((<PyObject **> data)[0])
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
 *                                       ndim - 1, inc)
 * 
 */
    /*else*/ {

      /* "View.MemoryView":1389
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1,
 *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
 * 
 *         data += strides[0]
 */
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
    }
    __pyx_L5:;

    /* "View.MemoryView":1391
 *                                       ndim - 1, inc)
 * 
 *         data += strides[0]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
  }

  /* "View.MemoryView":1377
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                     Py_ssize_t *strides, int ndim, bint inc):
 *     cdef Py_ssize_t i
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "View.MemoryView":1397
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) nogil:
 */

static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {

  /* "View.MemoryView":1400
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
 *                          itemsize, item)
 */
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1401
 *                               bint dtype_is_object) nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, False)
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
 *                          itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, True)
 */
  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);

  /* "View.MemoryView":1403
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
 *                          itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1397
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1407
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                               Py_ssize_t *strides, int ndim,
 *                               size_t itemsize, void *item) nogil:
 */

static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_extent;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;

  /* "View.MemoryView":1411
 *                               size_t itemsize, void *item) nogil:
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t extent = shape[0]
 * 
 */
  __pyx_v_stride = (__pyx_v_strides[0]);

  /* "View.MemoryView":1412
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]
 *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
 */
  __pyx_v_extent = (__pyx_v_shape[0]);

  /* "View.MemoryView":1414
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 */
  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1415
 * 
 *     if ndim == 1:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             memcpy(data, item, itemsize)
 *             data += stride
 */
    __pyx_t_2 = __pyx_v_extent;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":1416
 *     if ndim == 1:
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
 *             data += stride
 *     else:
 */
      (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));

      /* "View.MemoryView":1417
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 *             data += stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(extent):
 */
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }

    /* "View.MemoryView":1414
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1419
 *             data += stride
 *     else:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             _slice_assign_scalar(data, shape + 1, strides + 1,
 *                                 ndim - 1, itemsize, item)
 */
  /*else*/ {
    __pyx_t_2 = __pyx_v_extent;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":1420
 *     else:
 *         for i in range(extent):
 *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
 *                                 ndim - 1, itemsize, item)
 *             data += stride
 */
      __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);

      /* "View.MemoryView":1422
 *             _slice_assign_scalar(data, shape + 1, strides + 1,
 *                                 ndim - 1, itemsize, item)
 *             data += stride             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1407
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                               Py_ssize_t *strides, int ndim,
 *                               size_t itemsize, void *item) nogil:
 */

  /* function exit code */
}

/* "(tree fragment)":1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xb068931:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
 *     __pyx_result = Enum.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xb068931:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
 *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->name);
  __Pyx_DECREF(__pyx_v___pyx_result->name);
  __pyx_v___pyx_result->name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_4bpf4_4core_BpfInterface __pyx_vtable_4bpf4_4core_BpfInterface;

static PyObject *__pyx_tp_new_4bpf4_4core_BpfInterface(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_4bpf4_4core_BpfInterface *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)o);
  p->__pyx_vtab = __pyx_vtabptr_4bpf4_4core_BpfInterface;
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core_BpfInterface(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_4bpf4_4core_BpfInterface(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_4bpf4_4core_12BpfInterface_x0(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_12BpfInterface_2x0_1__get__(o);
}

static PyObject *__pyx_getprop_4bpf4_4core_12BpfInterface_x1(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_12BpfInterface_2x1_1__get__(o);
}

static PyMethodDef __pyx_methods_4bpf4_4core_BpfInterface[] = {
  {"bounds", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_7bounds, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_6bounds},
  {"_get_points_for_rendering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_37_get_points_for_rendering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_36_get_points_for_rendering},
  {"render", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_39render, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_38render},
  {"plot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_41plot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_40plot},
  {"max", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_111max, METH_O, __pyx_doc_4bpf4_4core_12BpfInterface_110max},
  {"min", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_113min, METH_O, __pyx_doc_4bpf4_4core_12BpfInterface_112min},
  {"__reduce__", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_115__reduce__, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_114__reduce__},
  {"keep_slope", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_119keep_slope, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_118keep_slope},
  {"outbound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_121outbound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_120outbound},
  {"apply", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_123apply, METH_O, __pyx_doc_4bpf4_4core_12BpfInterface_122apply},
  {"preapply", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_125preapply, METH_O, __pyx_doc_4bpf4_4core_12BpfInterface_124preapply},
  {"periodic", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_127periodic, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_126periodic},
  {"stretched", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_129stretched, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_128stretched},
  {"inverted", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_135inverted, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_134inverted},
  {"fromseq", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_141fromseq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_140fromseq},
  {"copy", (PyCFunction)__pyx_pw_4bpf4_4core_12BpfInterface_143copy, METH_NOARGS, __pyx_doc_4bpf4_4core_12BpfInterface_142copy},
  {"debug", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_12BpfInterface_147debug, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_12BpfInterface_146debug},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4bpf4_4core_BpfInterface[] = {
  {(char *)"x0", __pyx_getprop_4bpf4_4core_12BpfInterface_x0, 0, (char *)"The lower bound of the x coordinate", 0},
  {(char *)"x1", __pyx_getprop_4bpf4_4core_12BpfInterface_x1, 0, (char *)"The upper bound of the x coordinate", 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_BpfInterface = {
  __pyx_pw_4bpf4_4core_12BpfInterface_9__add__, /*nb_add*/
  __pyx_pw_4bpf4_4core_12BpfInterface_11__sub__, /*nb_subtract*/
  __pyx_pw_4bpf4_4core_12BpfInterface_13__mul__, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  __pyx_pw_4bpf4_4core_12BpfInterface_15__div__, /*nb_divide*/
  #endif
  __pyx_pw_4bpf4_4core_12BpfInterface_23__mod__, /*nb_remainder*/
  0, /*nb_divmod*/
  __pyx_pw_4bpf4_4core_12BpfInterface_19__pow__, /*nb_power*/
  __pyx_pw_4bpf4_4core_12BpfInterface_21__neg__, /*nb_negative*/
  0, /*nb_positive*/
  __pyx_pw_4bpf4_4core_12BpfInterface_25__abs__, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  __pyx_pw_4bpf4_4core_12BpfInterface_31__lshift__, /*nb_lshift*/
  __pyx_pw_4bpf4_4core_12BpfInterface_29__rshift__, /*nb_rshift*/
  0, /*nb_and*/
  __pyx_pw_4bpf4_4core_12BpfInterface_33__xor__, /*nb_xor*/
  __pyx_pw_4bpf4_4core_12BpfInterface_27__or__, /*nb_or*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  __pyx_pw_4bpf4_4core_12BpfInterface_17__truediv__, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  0, /*nb_index*/
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_matrix_multiply*/
  #endif
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_inplace_matrix_multiply*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_BpfInterface = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_4bpf4_4core_BpfInterface, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_BpfInterface = {
  0, /*mp_length*/
  __pyx_pw_4bpf4_4core_12BpfInterface_139__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_4bpf4_4core_BpfInterface = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.BpfInterface", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_BpfInterface), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  &__pyx_tp_as_number_BpfInterface, /*tp_as_number*/
  &__pyx_tp_as_sequence_BpfInterface, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_BpfInterface, /*tp_as_mapping*/
  0, /*tp_hash*/
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Base class for all Break-Point Functions\n\n    !!! note\n\n        BpfInterace is an abstract class. It is not possible to create \n        an instance of it. \n\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_pw_4bpf4_4core_12BpfInterface_35__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_BpfInterface, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4bpf4_4core_BpfInterface, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_BpfInterface, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_BpfBase __pyx_vtable_4bpf4_4core_BpfBase;

static PyObject *__pyx_tp_new_4bpf4_4core_BpfBase(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_BpfBase *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_BpfBase *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_BpfBase;
  p->xs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->ys = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_4bpf4_4core_7BpfBase_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_4bpf4_4core_BpfBase(PyObject *o) {
  struct __pyx_obj_4bpf4_4core_BpfBase *p = (struct __pyx_obj_4bpf4_4core_BpfBase *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_4bpf4_4core_7BpfBase_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->xs);
  Py_CLEAR(p->ys);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core_BpfBase(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core_BpfBase *p = (struct __pyx_obj_4bpf4_4core_BpfBase *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core_BpfBase)); if (e) return e;
  if (p->xs) {
    e = (*v)(((PyObject *)p->xs), a); if (e) return e;
  }
  if (p->ys) {
    e = (*v)(((PyObject *)p->ys), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core_BpfBase(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core_BpfBase *p = (struct __pyx_obj_4bpf4_4core_BpfBase *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core_BpfBase);
  tmp = ((PyObject*)p->xs);
  p->xs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->ys);
  p->ys = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_4bpf4_4core_7BpfBase_descriptor(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_7BpfBase_10descriptor_1__get__(o);
}

static PyObject *__pyx_getprop_4bpf4_4core_7BpfBase_exp(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_7BpfBase_3exp_1__get__(o);
}

static PyMethodDef __pyx_methods_4bpf4_4core_BpfBase[] = {
  {"outbound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7BpfBase_7outbound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7BpfBase_6outbound},
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_9__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_7BpfBase_8__getstate__},
  {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_11__setstate__, METH_O, __pyx_doc_4bpf4_4core_7BpfBase_10__setstate__},
  {"stretch", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_19stretch, METH_O, __pyx_doc_4bpf4_4core_7BpfBase_18stretch},
  {"shift", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_21shift, METH_O, __pyx_doc_4bpf4_4core_7BpfBase_20shift},
  {"points", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_23points, METH_NOARGS, __pyx_doc_4bpf4_4core_7BpfBase_22points},
  {"clone_with_new_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7BpfBase_25clone_with_new_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7BpfBase_24clone_with_new_data},
  {"insertpoint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7BpfBase_27insertpoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7BpfBase_26insertpoint},
  {"removepoint", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_29removepoint, METH_O, __pyx_doc_4bpf4_4core_7BpfBase_28removepoint},
  {"segments", (PyCFunction)__pyx_pw_4bpf4_4core_7BpfBase_31segments, METH_NOARGS, __pyx_doc_4bpf4_4core_7BpfBase_30segments},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4bpf4_4core_BpfBase[] = {
  {(char *)"descriptor", __pyx_getprop_4bpf4_4core_7BpfBase_descriptor, 0, (char *)"\n        A string describing the interpolation function of this bpf\n        ", 0},
  {(char *)"exp", __pyx_getprop_4bpf4_4core_7BpfBase_exp, 0, (char *)"\n        The exponential of the interpolation function of this bpf\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_BpfBase = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.BpfBase", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_BpfBase), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfBase, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_4bpf4_4core_7BpfBase_17__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "BpfBase(xs, ys)", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core_BpfBase, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core_BpfBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_BpfBase, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4bpf4_4core_BpfBase, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_7BpfBase_5__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_BpfBase, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Linear __pyx_vtable_4bpf4_4core_Linear;

static PyObject *__pyx_tp_new_4bpf4_4core_Linear(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Linear *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfBase(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Linear *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Linear;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core_Linear[] = {
  {"_get_points_for_rendering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_6Linear_3_get_points_for_rendering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_6Linear_2_get_points_for_rendering},
  {"inverted", (PyCFunction)__pyx_pw_4bpf4_4core_6Linear_9inverted, METH_NOARGS, __pyx_doc_4bpf4_4core_6Linear_8inverted},
  {"flatpairs", (PyCFunction)__pyx_pw_4bpf4_4core_6Linear_11flatpairs, METH_NOARGS, __pyx_doc_4bpf4_4core_6Linear_10flatpairs},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Linear = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Linear", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Linear), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfBase, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_7BpfBase_17__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Linear(xs, ys)\n\n    A bpf with linear interpolation\n\n    ```python\n    from bpf4 import *\n    a = core.Linear([0, 2, 3.5, 10], [0.1, 0.5, -3.5,  4])\n    a.plot()\n    ```\n    ![](assets/Linear.png)\n\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core_BpfBase, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core_BpfBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Linear, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_6Linear_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Linear, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Smooth __pyx_vtable_4bpf4_4core_Smooth;

static PyObject *__pyx_tp_new_4bpf4_4core_Smooth(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Smooth *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfBase(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Smooth *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Smooth;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core_Smooth[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Smooth = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Smooth", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Smooth), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfBase, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_7BpfBase_17__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Smooth(xs, ys, int numiter=1)\n\n    A bpf with smoothstep interpolation. \n\n    ```python\n\n    >>> a = Smooth([0, 1, 3, 10], [0.1, 0.5, -3.5,  1])\n    >>> a.plot()\n    ```\n    ![](assets/Smooth.png)\n\n    ```python\n    >>> a = core.Smooth([0, 1, 3, 10], [0.1, 0.5, -3.5,  1], numiter=3)\n    >>> a.plot()\n    ```\n    ![](assets/Smooth_numiter3.png)\n\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core_BpfBase, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core_BpfBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Smooth, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_6Smooth_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Smooth, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Smoother __pyx_vtable_4bpf4_4core_Smoother;

static PyObject *__pyx_tp_new_4bpf4_4core_Smoother(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Smoother *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfBase(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Smoother *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Smoother;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core_Smoother[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Smoother = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Smoother", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Smoother), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfBase, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_7BpfBase_17__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Smoother(xs, ys)\n\n    A bpf with smootherstep interpolation (perlin's variation of smoothstep) \n\n    ```python\n\n    a = core.Smooth([0, 1, 3, 10], [0.1, 0.5, -3.5,  1])\n    b = core.Smoother(*a.points())\n    fig, axes = plt.subplots(1, 2, figsize=(12, 4))\n    a.plot(axes=axes[0], show=False)\n    b.plot(axes=axes[1])\n    ```\n    ![](assets/Smoother.png)\n\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core_BpfBase, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core_BpfBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Smoother, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_8Smoother_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Smoother, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Halfcos __pyx_vtable_4bpf4_4core_Halfcos;

static PyObject *__pyx_tp_new_4bpf4_4core_Halfcos(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Halfcos *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfBase(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Halfcos *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Halfcos;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core_Halfcos[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_7Halfcos_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_7Halfcos_2__getstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Halfcos = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Halfcos", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Halfcos), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfBase, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_4bpf4_4core_7Halfcos_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Halfcos(xs, ys, double exp=1.0, int numiter=1)\n\n    A bpf with half-cosine interpolation\n\n    [HalfcosExp](#HalfcosExp) is the same as Halfcos. It exists with two\n    names for compatibility\n\n    ```python\n    a = core.Halfcos([0, 1, 3, 10], [0.1, 0.5, 3.5,  1])\n    b = core.Halfcos(*a.points(), exp=2)\n    c = core.Halfcos(*a.points(), exp=0.5)\n    fig, axes = plt.subplots(1, 3, figsize=(16, 4), tight_layout=True)\n    a.plot(axes=axes[0], show=False)\n    b.plot(axes=axes[1], show=False)\n    c.plot(axes=axes[2])\n    ```\n    ![](assets/Halfcos.png)\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core_BpfBase, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core_BpfBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Halfcos, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_7Halfcos_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Halfcos, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Halfcosm __pyx_vtable_4bpf4_4core_Halfcosm;

static PyObject *__pyx_tp_new_4bpf4_4core_Halfcosm(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Halfcosm *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_Halfcos(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Halfcosm *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Halfcosm;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core_Halfcosm[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Halfcosm = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Halfcosm", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Halfcosm), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfBase, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_7Halfcos_5__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Halfcosm(xs, ys, double exp=1.0, int numiter=1)\n\n    A bpf with half-cosine and exponent depending on the orientation of the interpolation\n\n    When interpolating between two y values, y0 and y1, if  y1 < y0 the exponent\n    is inverted, resulting in a symmetrical interpolation shape\n\n    ```python\n    a = core.Halfcos([0, 1, 3, 10], [0.1, 0.5, 3.5,  1], exp=2)\n    b = core.Halfcosm(*a.points(), exp=2)\n    fig, axes = plt.subplots(1, 2, figsize=(16, 4))\n    a.plot(axes=axes[0], show=False)\n    b.plot(axes=axes[1])\n    ```\n    ![](assets/Halfcosm.png)\n\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core_BpfBase, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core_BpfBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Halfcosm, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_8Halfcosm_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Halfcosm, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Expon __pyx_vtable_4bpf4_4core_Expon;

static PyObject *__pyx_tp_new_4bpf4_4core_Expon(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Expon *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfBase(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Expon *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Expon;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core_Expon[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_5Expon_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_5Expon_2__getstate__},
  {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_5Expon_5__setstate__, METH_O, __pyx_doc_4bpf4_4core_5Expon_4__setstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Expon = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Expon", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Expon), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfBase, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_4bpf4_4core_5Expon_7__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Expon(xs, ys, double exp, int numiter=1)\n\n    A bpf with exponential interpolation\n\n    Example\n    -------\n\n    ```python\n    from bpf4 import *\n    import matplotlib.pyplot as plt\n    numplots = 5\n    fig, axs = plt.subplots(2, numplots, tight_layout=True, figsize=(20, 8))\n    for i in range(numplots):\n        exp = i+1\n        core.Expon([0, 1, 2], [0, 1, 0], exp=exp).plot(show=False, axes=axs[0, i])\n        core.Expon([0, 1, 2], [0, 1, 0], exp=1/exp).plot(show=False, axes=axs[1, i])\n        axs[0, i].set_title(f'{exp=}')\n        axs[1, i].set_title(f'exp={1/exp:.2f}')\n\n    plot.show()\n\n    ```\n    ![](assets/expon-grid2.png)\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core_BpfBase, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core_BpfBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Expon, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_5Expon_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Expon, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Exponm __pyx_vtable_4bpf4_4core_Exponm;

static PyObject *__pyx_tp_new_4bpf4_4core_Exponm(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Exponm *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_Expon(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Exponm *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Exponm;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core_Exponm[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Exponm = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Exponm", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Exponm), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfBase, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_5Expon_7__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Exponm(xs, ys, double exp, int numiter=1)\n\n    A bpf with symmetrical exponential interpolation \n\n    ```python\n    from bpf4 import *\n    import matplotlib.pyplot as plt\n    numplots = 5\n    fig, axs = plt.subplots(2, numplots, tight_layout=True, figsize=(20, 8))\n    for i in range(numplots):\n        exp = i+1\n        core.Exponm([0, 1, 2], [0, 1, 0], exp=exp).plot(show=False, axes=axs[0, i])\n        core.Exponm([0, 1, 2], [0, 1, 0], exp=1/exp).plot(show=False, axes=axs[1, i])\n        axs[0, i].set_title(f'{exp=}')\n        axs[1, i].set_title(f'exp={1/exp:.2f}')\n\n    plot.show()\n    ```\n\n    ![](assets/exponm-grid.png)\n    \n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core_BpfBase, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core_BpfBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Exponm, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_6Exponm_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Exponm, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_NoInterpol __pyx_vtable_4bpf4_4core_NoInterpol;

static PyObject *__pyx_tp_new_4bpf4_4core_NoInterpol(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_NoInterpol *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfBase(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_NoInterpol *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_NoInterpol;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core_NoInterpol[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_NoInterpol = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.NoInterpol", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_NoInterpol), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfBase, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_7BpfBase_17__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "NoInterpol(xs, ys)\n\n    A bpf without interpolation\n\n    ```python\n    a = core.Linear([0, 1, 3, 10], [0.1, 0.5, 3.5,  1])\n    b = core.NoInterpol(*a.points())\n    c = core.Nearest(*a.points())\n    fig, axes = plt.subplots(1, 3, figsize=(15, 4), tight_layout=True)\n    a.plot(axes=axes[0], show=False)\n    b.plot(axes=axes[1], show=False)\n    c.plot(axes=axes[2])\n    ```\n    ![](assets/NoInterpol.png)\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core_BpfBase, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core_BpfBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_NoInterpol, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_10NoInterpol_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_NoInterpol, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Nearest __pyx_vtable_4bpf4_4core_Nearest;

static PyObject *__pyx_tp_new_4bpf4_4core_Nearest(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Nearest *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfBase(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Nearest *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Nearest;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core_Nearest[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_7Nearest_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_7Nearest_2__getstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Nearest = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Nearest", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Nearest), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfBase, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_7BpfBase_17__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Nearest(xs, ys)\n\n    A bpf with nearest interpolation\n\n    ```python\n    a = core.Linear([0, 1, 3, 10], [0.1, 0.5, 3.5,  1])\n    b = core.NoInterpol(*a.points())\n    c = core.Nearest(*a.points())\n    fig, axes = plt.subplots(1, 3, figsize=(15, 4), tight_layout=True)\n    a.plot(axes=axes[0], show=False)\n    b.plot(axes=axes[1], show=False)\n    c.plot(axes=axes[2])\n    ```\n    ![](assets/NoInterpol.png)\n    \n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core_BpfBase, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core_BpfBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Nearest, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_7Nearest_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Nearest, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Sampled __pyx_vtable_4bpf4_4core_Sampled;

static PyObject *__pyx_tp_new_4bpf4_4core_Sampled(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Sampled *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Sampled *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Sampled;
  p->ys = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->_cached_xs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core_Sampled(PyObject *o) {
  struct __pyx_obj_4bpf4_4core_Sampled *p = (struct __pyx_obj_4bpf4_4core_Sampled *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_4bpf4_4core_7Sampled_7__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->ys);
  Py_CLEAR(p->_cached_xs);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core_Sampled(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core_Sampled *p = (struct __pyx_obj_4bpf4_4core_Sampled *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core_Sampled)); if (e) return e;
  if (p->ys) {
    e = (*v)(((PyObject *)p->ys), a); if (e) return e;
  }
  if (p->_cached_xs) {
    e = (*v)(((PyObject *)p->_cached_xs), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core_Sampled(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core_Sampled *p = (struct __pyx_obj_4bpf4_4core_Sampled *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core_Sampled);
  tmp = ((PyObject*)p->ys);
  p->ys = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_cached_xs);
  p->_cached_xs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_4bpf4_4core_7Sampled_samplerate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_7Sampled_10samplerate_1__get__(o);
}

static PyObject *__pyx_getprop_4bpf4_4core_7Sampled_xs(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_7Sampled_2xs_1__get__(o);
}

static PyObject *__pyx_getprop_4bpf4_4core_7Sampled_interpolation(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_7Sampled_13interpolation_1__get__(o);
}

static int __pyx_setprop_4bpf4_4core_7Sampled_interpolation(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4bpf4_4core_7Sampled_13interpolation_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4bpf4_4core_7Sampled_dx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_7Sampled_2dx_1__get__(o);
}

static PyObject *__pyx_getprop_4bpf4_4core_7Sampled_ys(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_7Sampled_2ys_1__get__(o);
}

static PyMethodDef __pyx_methods_4bpf4_4core_Sampled[] = {
  {"points", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_3points, METH_NOARGS, __pyx_doc_4bpf4_4core_7Sampled_2points},
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_9__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_7Sampled_8__getstate__},
  {"fromseq", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7Sampled_13fromseq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7Sampled_12fromseq},
  {"_get_points_for_rendering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_7Sampled_15_get_points_for_rendering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_7Sampled_14_get_points_for_rendering},
  {"segments", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_17segments, METH_NOARGS, __pyx_doc_4bpf4_4core_7Sampled_16segments},
  {"inverted", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_26inverted, METH_NOARGS, __pyx_doc_4bpf4_4core_7Sampled_25inverted},
  {"flatpairs", (PyCFunction)__pyx_pw_4bpf4_4core_7Sampled_28flatpairs, METH_NOARGS, __pyx_doc_4bpf4_4core_7Sampled_27flatpairs},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4bpf4_4core_Sampled[] = {
  {(char *)"samplerate", __pyx_getprop_4bpf4_4core_7Sampled_samplerate, 0, (char *)"\n        The samplerate of this bpf\n        ", 0},
  {(char *)"xs", __pyx_getprop_4bpf4_4core_7Sampled_xs, 0, (char *)"\n        The x-coord array of this bpf\n        ", 0},
  {(char *)"interpolation", __pyx_getprop_4bpf4_4core_7Sampled_interpolation, __pyx_setprop_4bpf4_4core_7Sampled_interpolation, (char *)0, 0},
  {(char *)"dx", __pyx_getprop_4bpf4_4core_7Sampled_dx, 0, (char *)"\n        The sampling period (delta x)\n        ", 0},
  {(char *)"ys", __pyx_getprop_4bpf4_4core_7Sampled_ys, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Sampled = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Sampled", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Sampled), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_Sampled, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Sampled(samples, double dx, double x0=0, unicode interpolation=u'linear')\n\n    A bpf with regularly sampled data\n\n    When evaluated, values between the samples are interpolated with\n    a given function: linear, expon(x), halfcos, halfcos(x), etc.\n\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core_Sampled, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core_Sampled, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Sampled, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4bpf4_4core_Sampled, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_7Sampled_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Sampled, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Spline __pyx_vtable_4bpf4_4core_Spline;

static PyObject *__pyx_tp_new_4bpf4_4core_Spline(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Spline *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Spline *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Spline;
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core_Spline(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_4bpf4_4core_6Spline_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static PyMethodDef __pyx_methods_4bpf4_4core_Spline[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_6Spline_5__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_6Spline_4__getstate__},
  {"points", (PyCFunction)__pyx_pw_4bpf4_4core_6Spline_7points, METH_NOARGS, __pyx_doc_4bpf4_4core_6Spline_6points},
  {"segments", (PyCFunction)__pyx_pw_4bpf4_4core_6Spline_9segments, METH_NOARGS, __pyx_doc_4bpf4_4core_6Spline_8segments},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Spline = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Spline", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Spline), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_Spline, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Spline(xs, ys)\n\n    A bpf with cubic spline interpolation\n\n    With cubic spline interpolation, for each point `(x, y)` \n    it is ensured that `bpf(x) == y`. Between the defined points,\n    depending on their proximity, this bpf can overshoot\n    \n    Example\n    -------\n\n    ```python\n    a = core.Smooth([0, 1, 3, 10], [0.1, 0.5, -3.5,  1])\n    b = core.Spline(*a.points())\n    fig, axes = plt.subplots(1, 2, figsize=(12, 4))\n    a.plot(axes=axes[0], show=False)\n    b.plot(axes=axes[1])\n    ```\n    ![](assets/Spline.png)\n\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Spline, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_6Spline_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Spline, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_USpline __pyx_vtable_4bpf4_4core_USpline;

static PyObject *__pyx_tp_new_4bpf4_4core_USpline(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_USpline *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_USpline *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_USpline;
  p->spline = Py_None; Py_INCREF(Py_None);
  p->spline__call__ = Py_None; Py_INCREF(Py_None);
  p->xs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->ys = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core_USpline(PyObject *o) {
  struct __pyx_obj_4bpf4_4core_USpline *p = (struct __pyx_obj_4bpf4_4core_USpline *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->spline);
  Py_CLEAR(p->spline__call__);
  Py_CLEAR(p->xs);
  Py_CLEAR(p->ys);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core_USpline(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core_USpline *p = (struct __pyx_obj_4bpf4_4core_USpline *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core_USpline)); if (e) return e;
  if (p->spline) {
    e = (*v)(p->spline, a); if (e) return e;
  }
  if (p->spline__call__) {
    e = (*v)(p->spline__call__, a); if (e) return e;
  }
  if (p->xs) {
    e = (*v)(((PyObject *)p->xs), a); if (e) return e;
  }
  if (p->ys) {
    e = (*v)(((PyObject *)p->ys), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core_USpline(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core_USpline *p = (struct __pyx_obj_4bpf4_4core_USpline *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core_USpline);
  tmp = ((PyObject*)p->spline);
  p->spline = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->spline__call__);
  p->spline__call__ = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->xs);
  p->xs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->ys);
  p->ys = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_4bpf4_4core_7USpline__spline(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_7USpline_7_spline_1__get__(o);
}

static PyMethodDef __pyx_methods_4bpf4_4core_USpline[] = {
  {"segments", (PyCFunction)__pyx_pw_4bpf4_4core_7USpline_9segments, METH_NOARGS, __pyx_doc_4bpf4_4core_7USpline_8segments},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4bpf4_4core_USpline[] = {
  {(char *)"_spline", __pyx_getprop_4bpf4_4core_7USpline__spline, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_USpline = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.USpline", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_USpline), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_USpline, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  __pyx_pw_4bpf4_4core_7USpline_3__call__, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "USpline(xs, ys)\n\n    bpf with univariate spline interpolation. \n\n    ```python\n    a = core.Spline([0, 1, 3, 10], [0.1, 0.5, -3.5,  1])\n    b = core.USpline(*a.points())\n\n    fig, axes = plt.subplots(1, 2, figsize=(12, 4), sharey=True, tight_layout=True)\n    a.plot(axes=axes[0], show=False)\n    b.plot(axes=axes[1])\n    ```\n    ![](assets/Uspline.png)\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core_USpline, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core_USpline, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_USpline, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4bpf4_4core_USpline, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_7USpline_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_USpline, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfConcat2 __pyx_vtable_4bpf4_4core__BpfConcat2;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfConcat2(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfConcat2 *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfConcat2 *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfConcat2;
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  p->b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfConcat2(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfConcat2 *p = (struct __pyx_obj_4bpf4_4core__BpfConcat2 *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->a);
  Py_CLEAR(p->b);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfConcat2(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfConcat2 *p = (struct __pyx_obj_4bpf4_4core__BpfConcat2 *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfConcat2)); if (e) return e;
  if (p->a) {
    e = (*v)(((PyObject *)p->a), a); if (e) return e;
  }
  if (p->b) {
    e = (*v)(((PyObject *)p->b), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfConcat2(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfConcat2 *p = (struct __pyx_obj_4bpf4_4core__BpfConcat2 *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfConcat2);
  tmp = ((PyObject*)p->a);
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->b);
  p->b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfConcat2[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_11_BpfConcat2_1__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_11_BpfConcat2___getstate__},
  {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_11_BpfConcat2_3__setstate__, METH_O, __pyx_doc_4bpf4_4core_11_BpfConcat2_2__setstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfConcat2 = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfConcat2", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfConcat2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfConcat2, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfConcat2, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfConcat2, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfConcat2, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfConcat2, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Slope __pyx_vtable_4bpf4_4core_Slope;

static PyObject *__pyx_tp_new_4bpf4_4core_Slope(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Slope *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Slope *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Slope;
  return o;
}

static PyObject *__pyx_getprop_4bpf4_4core_5Slope_slope(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_5Slope_5slope_1__get__(o);
}

static int __pyx_setprop_4bpf4_4core_5Slope_slope(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4bpf4_4core_5Slope_5slope_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4bpf4_4core_5Slope_offset(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_5Slope_6offset_1__get__(o);
}

static int __pyx_setprop_4bpf4_4core_5Slope_offset(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4bpf4_4core_5Slope_6offset_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_4bpf4_4core_Slope[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_5Slope_13__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_5Slope_12__getstate__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4bpf4_4core_Slope[] = {
  {(char *)"slope", __pyx_getprop_4bpf4_4core_5Slope_slope, __pyx_setprop_4bpf4_4core_5Slope_slope, (char *)"slope: 'double'", 0},
  {(char *)"offset", __pyx_getprop_4bpf4_4core_5Slope_offset, __pyx_setprop_4bpf4_4core_5Slope_offset, (char *)"offset: 'double'", 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Slope = {
  __pyx_pw_4bpf4_4core_5Slope_5__add__, /*nb_add*/
  __pyx_pw_4bpf4_4core_5Slope_7__sub__, /*nb_subtract*/
  __pyx_pw_4bpf4_4core_5Slope_11__mul__, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_15__div__, /*nb_divide*/
  #else
  0, /*nb_divide*/
  #endif
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_23__mod__, /*nb_remainder*/
  #else
  0, /*nb_remainder*/
  #endif
  0, /*nb_divmod*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_19__pow__, /*nb_power*/
  #else
  0, /*nb_power*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_21__neg__, /*nb_negative*/
  #else
  0, /*nb_negative*/
  #endif
  0, /*nb_positive*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_25__abs__, /*nb_absolute*/
  #else
  0, /*nb_absolute*/
  #endif
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_31__lshift__, /*nb_lshift*/
  #else
  0, /*nb_lshift*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_29__rshift__, /*nb_rshift*/
  #else
  0, /*nb_rshift*/
  #endif
  0, /*nb_and*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_33__xor__, /*nb_xor*/
  #else
  0, /*nb_xor*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_27__or__, /*nb_or*/
  #else
  0, /*nb_or*/
  #endif
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_17__truediv__, /*nb_true_divide*/
  #else
  0, /*nb_true_divide*/
  #endif
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  0, /*nb_index*/
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_matrix_multiply*/
  #endif
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_inplace_matrix_multiply*/
  #endif
};

static PyTypeObject __pyx_type_4bpf4_4core_Slope = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Slope", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Slope), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  &__pyx_tp_as_number_Slope, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Slope(double slope, double offset=0, tuple bounds=None)\n\n    A bpf representing a linear equation `y = slope * x + offset`\n\n    ```python\n\n    >>> from bpf4.core import *\n    >>> a = Slope(0.5, 1)\n    >>> a\n    Slope[-inf:inf]\n    >>> a[0:10].plot()\n    ```\n    ![](assets/slope-plot.png)\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Slope, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4bpf4_4core_Slope, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_5Slope_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Slope, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfCompose __pyx_vtable_4bpf4_4core__BpfCompose;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfCompose(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfCompose *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfCompose *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfCompose;
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  p->b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfCompose(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfCompose *p = (struct __pyx_obj_4bpf4_4core__BpfCompose *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->a);
  Py_CLEAR(p->b);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfCompose(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfCompose *p = (struct __pyx_obj_4bpf4_4core__BpfCompose *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfCompose)); if (e) return e;
  if (p->a) {
    e = (*v)(((PyObject *)p->a), a); if (e) return e;
  }
  if (p->b) {
    e = (*v)(((PyObject *)p->b), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfCompose(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfCompose *p = (struct __pyx_obj_4bpf4_4core__BpfCompose *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfCompose);
  tmp = ((PyObject*)p->a);
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->b);
  p->b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfCompose[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_11_BpfCompose_1__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_11_BpfCompose___getstate__},
  {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_11_BpfCompose_3__setstate__, METH_O, __pyx_doc_4bpf4_4core_11_BpfCompose_2__setstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfCompose = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfCompose", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfCompose), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfCompose, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A bpf representing function composition `f(x) = b(a(x))`\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfCompose, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfCompose, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfCompose, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfCompose, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfConcat __pyx_vtable_4bpf4_4core__BpfConcat;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfConcat(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfConcat *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfConcat *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfConcat;
  p->bpfs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->last_bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  p->bpf0 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  p->bpf1 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_4bpf4_4core_10_BpfConcat_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfConcat(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfConcat *p = (struct __pyx_obj_4bpf4_4core__BpfConcat *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_4bpf4_4core_10_BpfConcat_5__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->bpfs);
  Py_CLEAR(p->last_bpf);
  Py_CLEAR(p->bpf0);
  Py_CLEAR(p->bpf1);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfConcat(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfConcat *p = (struct __pyx_obj_4bpf4_4core__BpfConcat *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfConcat)); if (e) return e;
  if (p->bpfs) {
    e = (*v)(p->bpfs, a); if (e) return e;
  }
  if (p->last_bpf) {
    e = (*v)(((PyObject *)p->last_bpf), a); if (e) return e;
  }
  if (p->bpf0) {
    e = (*v)(((PyObject *)p->bpf0), a); if (e) return e;
  }
  if (p->bpf1) {
    e = (*v)(((PyObject *)p->bpf1), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfConcat(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfConcat *p = (struct __pyx_obj_4bpf4_4core__BpfConcat *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfConcat);
  tmp = ((PyObject*)p->bpfs);
  p->bpfs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->last_bpf);
  p->last_bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->bpf0);
  p->bpf0 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->bpf1);
  p->bpf1 = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfConcat[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_10_BpfConcat_9__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_10_BpfConcat_8__getstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfConcat = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfConcat", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfConcat), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfConcat, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfConcat(xs, bpfs)\n\n    A bpf representing the concatenation of multiple bpfs\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfConcat, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfConcat, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfConcat, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_10_BpfConcat_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfConcat, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfBlend __pyx_vtable_4bpf4_4core__BpfBlend;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfBlend(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfBlend *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfBlend *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfBlend;
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  p->b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  p->which = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfBlend(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfBlend *p = (struct __pyx_obj_4bpf4_4core__BpfBlend *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->a);
  Py_CLEAR(p->b);
  Py_CLEAR(p->which);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfBlend(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfBlend *p = (struct __pyx_obj_4bpf4_4core__BpfBlend *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfBlend)); if (e) return e;
  if (p->a) {
    e = (*v)(((PyObject *)p->a), a); if (e) return e;
  }
  if (p->b) {
    e = (*v)(((PyObject *)p->b), a); if (e) return e;
  }
  if (p->which) {
    e = (*v)(((PyObject *)p->which), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfBlend(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfBlend *p = (struct __pyx_obj_4bpf4_4core__BpfBlend *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfBlend);
  tmp = ((PyObject*)p->a);
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->b);
  p->b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->which);
  p->which = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfBlend[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_9_BpfBlend_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_9_BpfBlend_2__getstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfBlend = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfBlend", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfBlend), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBlend, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfBlend(BpfInterface a: BpfInterface, BpfInterface b: BpfInterface, BpfInterface which: BpfInterface)", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBlend, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBlend, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfBlend, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_9_BpfBlend_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfBlend, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfBlendConst __pyx_vtable_4bpf4_4core__BpfBlendConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfBlendConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfBlendConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfBlendConst *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfBlendConst;
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  p->b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfBlendConst(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfBlendConst *p = (struct __pyx_obj_4bpf4_4core__BpfBlendConst *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->a);
  Py_CLEAR(p->b);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfBlendConst(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfBlendConst *p = (struct __pyx_obj_4bpf4_4core__BpfBlendConst *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfBlendConst)); if (e) return e;
  if (p->a) {
    e = (*v)(((PyObject *)p->a), a); if (e) return e;
  }
  if (p->b) {
    e = (*v)(((PyObject *)p->b), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfBlendConst(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfBlendConst *p = (struct __pyx_obj_4bpf4_4core__BpfBlendConst *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfBlendConst);
  tmp = ((PyObject*)p->a);
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->b);
  p->b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfBlendConst[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfBlendConst_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_14_BpfBlendConst_2__getstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfBlendConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfBlendConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfBlendConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBlendConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfBlendConst(BpfInterface a, BpfInterface b, double which)", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBlendConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBlendConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfBlendConst, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_14_BpfBlendConst_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfBlendConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Multi __pyx_vtable_4bpf4_4core_Multi;

static PyObject *__pyx_tp_new_4bpf4_4core_Multi(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Multi *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Multi *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Multi;
  if (unlikely(__pyx_pw_4bpf4_4core_5Multi_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_4bpf4_4core_Multi(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_4bpf4_4core_5Multi_5__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static PyMethodDef __pyx_methods_4bpf4_4core_Multi[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_5Multi_7__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_5Multi_6__getstate__},
  {"segments", (PyCFunction)__pyx_pw_4bpf4_4core_5Multi_9segments, METH_NOARGS, __pyx_doc_4bpf4_4core_5Multi_8segments},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Multi = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Multi", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Multi), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_Multi, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Multi(xs, ys, interpolations)\n\n    A bpf where each segment can have its own interpolation kind\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Multi, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_5Multi_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Multi, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__FunctionWrap_Object __pyx_vtable_4bpf4_4core__FunctionWrap_Object;

static PyObject *__pyx_tp_new_4bpf4_4core__FunctionWrap_Object(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__FunctionWrap_Object;
  p->f = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__FunctionWrap_Object(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *p = (struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->f);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__FunctionWrap_Object(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *p = (struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__FunctionWrap_Object)); if (e) return e;
  if (p->f) {
    e = (*v)(p->f, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__FunctionWrap_Object(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *p = (struct __pyx_obj_4bpf4_4core__FunctionWrap_Object *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__FunctionWrap_Object);
  tmp = ((PyObject*)p->f);
  p->f = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__FunctionWrap_Object[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_20_FunctionWrap_Object_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_20_FunctionWrap_Object_2__getstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__FunctionWrap_Object = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._FunctionWrap_Object", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__FunctionWrap_Object, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_FunctionWrap_Object(f, bounds=(-inf, inf))", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__FunctionWrap_Object, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__FunctionWrap_Object, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__FunctionWrap_Object, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_20_FunctionWrap_Object_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__FunctionWrap_Object, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__FunctionWrap_Object_OutboundConst __pyx_vtable_4bpf4_4core__FunctionWrap_Object_OutboundConst;

static PyObject *__pyx_tp_new_4bpf4_4core__FunctionWrap_Object_OutboundConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__FunctionWrap_Object_OutboundConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__FunctionWrap_Object(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__FunctionWrap_Object_OutboundConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__FunctionWrap_Object_OutboundConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__FunctionWrap_Object_OutboundConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._FunctionWrap_Object_OutboundConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__FunctionWrap_Object_OutboundConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__FunctionWrap_Object, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__FunctionWrap_Object, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__FunctionWrap_Object, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_20_FunctionWrap_Object_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__FunctionWrap_Object_OutboundConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Const __pyx_vtable_4bpf4_4core_Const;

static PyObject *__pyx_tp_new_4bpf4_4core_Const(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Const *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Const *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Const;
  return o;
}
static PyObject *__pyx_sq_item_4bpf4_4core_Const(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyMethodDef __pyx_methods_4bpf4_4core_Const[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_5Const_5__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_5Const_4__getstate__},
  {"_get_points_for_rendering", (PyCFunction)__pyx_pw_4bpf4_4core_5Const_7_get_points_for_rendering, METH_O, __pyx_doc_4bpf4_4core_5Const_6_get_points_for_rendering},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Const = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_4bpf4_4core_Const, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Const = {
  0, /*mp_length*/
  __pyx_pw_4bpf4_4core_5Const_9__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_4bpf4_4core_Const = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Const", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Const), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Const, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Const, /*tp_as_mapping*/
  0, /*tp_hash*/
  __pyx_pw_4bpf4_4core_5Const_3__call__, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Const(double value, bounds: tuple[float, float] = None)\n\n    A bpf representing a constant value\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Const, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_5Const_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Const, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfBinOp __pyx_vtable_4bpf4_4core__BpfBinOp;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfBinOp(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfBinOp *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfBinOp *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  p->b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfBinOp(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfBinOp *p = (struct __pyx_obj_4bpf4_4core__BpfBinOp *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->a);
  Py_CLEAR(p->b);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfBinOp(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfBinOp *p = (struct __pyx_obj_4bpf4_4core__BpfBinOp *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfBinOp)); if (e) return e;
  if (p->a) {
    e = (*v)(((PyObject *)p->a), a); if (e) return e;
  }
  if (p->b) {
    e = (*v)(((PyObject *)p->b), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfBinOp(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfBinOp *p = (struct __pyx_obj_4bpf4_4core__BpfBinOp *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfBinOp);
  tmp = ((PyObject*)p->a);
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->b);
  p->b = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfBinOp[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_9_BpfBinOp_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_9_BpfBinOp_2__getstate__},
  {"_get_xs_for_rendering", (PyCFunction)__pyx_pw_4bpf4_4core_9_BpfBinOp_5_get_xs_for_rendering, METH_O, __pyx_doc_4bpf4_4core_9_BpfBinOp_4_get_xs_for_rendering},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfBinOp = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfBinOp", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfBinOp), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfBinOp(BpfInterface a, BpfInterface b, tuple bounds)\n\n    A bpf representing a binary operation between two bpfs\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfBinOp, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfBinOp, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryFunc __pyx_vtable_4bpf4_4core__BpfUnaryFunc;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfUnaryFunc(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfUnaryFunc;
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfUnaryFunc(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *p = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->a);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfUnaryFunc(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *p = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfUnaryFunc)); if (e) return e;
  if (p->a) {
    e = (*v)(((PyObject *)p->a), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfUnaryFunc(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *p = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfUnaryFunc);
  tmp = ((PyObject*)p->a);
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfUnaryFunc[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_1__reduce__, METH_NOARGS, __pyx_doc_4bpf4_4core_13_BpfUnaryFunc___reduce__},
  {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_13_BpfUnaryFunc_3__setstate__, METH_O, __pyx_doc_4bpf4_4core_13_BpfUnaryFunc_2__setstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfUnaryFunc = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfUnaryFunc", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfUnaryFunc, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfUnaryFunc, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfUnaryFunc, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfUnaryFunc, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfUnaryFunc, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfUnaryOp __pyx_vtable_4bpf4_4core__BpfUnaryOp;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfUnaryOp(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryOp *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfUnaryOp *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfUnaryOp;
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfUnaryOp(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfUnaryOp *p = (struct __pyx_obj_4bpf4_4core__BpfUnaryOp *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->a);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfUnaryOp(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfUnaryOp *p = (struct __pyx_obj_4bpf4_4core__BpfUnaryOp *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfUnaryOp)); if (e) return e;
  if (p->a) {
    e = (*v)(((PyObject *)p->a), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfUnaryOp(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfUnaryOp *p = (struct __pyx_obj_4bpf4_4core__BpfUnaryOp *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfUnaryOp);
  tmp = ((PyObject*)p->a);
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfUnaryOp[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_11_BpfUnaryOp_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_11_BpfUnaryOp_2__getstate__},
  {"_get_xs_for_rendering", (PyCFunction)__pyx_pw_4bpf4_4core_11_BpfUnaryOp_5_get_xs_for_rendering, METH_O, __pyx_doc_4bpf4_4core_11_BpfUnaryOp_4_get_xs_for_rendering},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfUnaryOp = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfUnaryOp", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfUnaryOp), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfUnaryOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfUnaryOp(BpfInterface a)\n\n    A bpf representing a unary operation on a bpf\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfUnaryOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfUnaryOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfUnaryOp, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_11_BpfUnaryOp_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfUnaryOp, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfBinOpConst __pyx_vtable_4bpf4_4core__BpfBinOpConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfBinOpConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfBinOpConst *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst *p = (struct __pyx_obj_4bpf4_4core__BpfBinOpConst *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->a);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst *p = (struct __pyx_obj_4bpf4_4core__BpfBinOpConst *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst)); if (e) return e;
  if (p->a) {
    e = (*v)(((PyObject *)p->a), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfBinOpConst(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfBinOpConst *p = (struct __pyx_obj_4bpf4_4core__BpfBinOpConst *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfBinOpConst);
  tmp = ((PyObject*)p->a);
  p->a = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfBinOpConst[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfBinOpConst_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_14_BpfBinOpConst_2__getstate__},
  {"_get_xs_for_rendering", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfBinOpConst_5_get_xs_for_rendering, METH_O, __pyx_doc_4bpf4_4core_14_BpfBinOpConst_4_get_xs_for_rendering},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfBinOpConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfBinOpConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfBinOpConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfBinOpConst(BpfInterface a, double b, tuple bounds, unicode op=u'')\n\n    A bpf representing a binary operation between a bpf and a constant value\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfBinOpConst, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfBinOpConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaAdd __pyx_vtable_4bpf4_4core__BpfLambdaAdd;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaAdd(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaAdd *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaAdd *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaAdd;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfLambdaAdd[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaAdd = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaAdd", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaAdd), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfLambdaAdd, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaAdd, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaAddConst __pyx_vtable_4bpf4_4core__BpfLambdaAddConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaAddConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaAddConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaAddConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaAddConst;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfLambdaAddConst[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__BpfLambdaAddConst = {
  __pyx_pw_4bpf4_4core_18_BpfLambdaAddConst_1__add__, /*nb_add*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_11__sub__, /*nb_subtract*/
  #else
  0, /*nb_subtract*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_13__mul__, /*nb_multiply*/
  #else
  0, /*nb_multiply*/
  #endif
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_15__div__, /*nb_divide*/
  #else
  0, /*nb_divide*/
  #endif
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_23__mod__, /*nb_remainder*/
  #else
  0, /*nb_remainder*/
  #endif
  0, /*nb_divmod*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_19__pow__, /*nb_power*/
  #else
  0, /*nb_power*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_21__neg__, /*nb_negative*/
  #else
  0, /*nb_negative*/
  #endif
  0, /*nb_positive*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_25__abs__, /*nb_absolute*/
  #else
  0, /*nb_absolute*/
  #endif
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_31__lshift__, /*nb_lshift*/
  #else
  0, /*nb_lshift*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_29__rshift__, /*nb_rshift*/
  #else
  0, /*nb_rshift*/
  #endif
  0, /*nb_and*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_33__xor__, /*nb_xor*/
  #else
  0, /*nb_xor*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_27__or__, /*nb_or*/
  #else
  0, /*nb_or*/
  #endif
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_17__truediv__, /*nb_true_divide*/
  #else
  0, /*nb_true_divide*/
  #endif
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  0, /*nb_index*/
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_matrix_multiply*/
  #endif
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_inplace_matrix_multiply*/
  #endif
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaAddConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaAddConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaAddConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  &__pyx_tp_as_number__BpfLambdaAddConst, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfLambdaAddConst, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaAddConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaSub __pyx_vtable_4bpf4_4core__BpfLambdaSub;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaSub(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaSub *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaSub *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaSub;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfLambdaSub[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaSub = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaSub", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaSub), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfLambdaSub, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaSub, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRSub __pyx_vtable_4bpf4_4core__BpfLambdaRSub;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaRSub(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaRSub *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaRSub *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaRSub;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfLambdaRSub[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaRSub = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaRSub", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaRSub), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfLambdaRSub, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaRSub, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaSubConst __pyx_vtable_4bpf4_4core__BpfLambdaSubConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaSubConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaSubConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaSubConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaSubConst;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfLambdaSubConst[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaSubConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaSubConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaSubConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfLambdaSubConst, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaSubConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRSubConst __pyx_vtable_4bpf4_4core__BpfLambdaRSubConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaRSubConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaRSubConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaRSubConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaRSubConst;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfLambdaRSubConst[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaRSubConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaRSubConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaRSubConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfLambdaRSubConst, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaRSubConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaMul __pyx_vtable_4bpf4_4core__BpfLambdaMul;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaMul(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaMul *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaMul *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaMul;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaMul = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaMul", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaMul), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaMul, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaMulConst __pyx_vtable_4bpf4_4core__BpfLambdaMulConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaMulConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaMulConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaMulConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaMulConst;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfLambdaMulConst[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaMulConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaMulConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaMulConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfLambdaMulConst, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaMulConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaPow __pyx_vtable_4bpf4_4core__BpfLambdaPow;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaPow(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaPow *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaPow *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaPow;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaPow = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaPow", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaPow), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaPow, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaPowConst __pyx_vtable_4bpf4_4core__BpfLambdaPowConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaPowConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaPowConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaPowConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaPowConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaPowConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaPowConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaPowConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaPowConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRPowConst __pyx_vtable_4bpf4_4core__BpfLambdaRPowConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaRPowConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaRPowConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaRPowConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaRPowConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaRPowConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaRPowConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaRPowConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaRPowConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaDiv __pyx_vtable_4bpf4_4core__BpfLambdaDiv;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaDiv(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaDiv *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaDiv *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaDiv;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaDiv = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaDiv", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaDiv), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaDiv, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaDivConst __pyx_vtable_4bpf4_4core__BpfLambdaDivConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaDivConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaDivConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaDivConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaDivConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaDivConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaDivConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaDivConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaDivConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaMod __pyx_vtable_4bpf4_4core__BpfLambdaMod;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaMod(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaMod *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaMod *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaMod;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaMod = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaMod", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaMod), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaMod, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaModConst __pyx_vtable_4bpf4_4core__BpfLambdaModConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaModConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaModConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaModConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaModConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaModConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaModConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaModConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaModConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRDiv __pyx_vtable_4bpf4_4core__BpfLambdaRDiv;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaRDiv(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaRDiv *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaRDiv *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaRDiv;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaRDiv = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaRDiv", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaRDiv), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaRDiv, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRDivConst __pyx_vtable_4bpf4_4core__BpfLambdaRDivConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaRDivConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaRDivConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaRDivConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaRDivConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaRDivConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaRDivConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaRDivConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaRDivConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaGreaterThan __pyx_vtable_4bpf4_4core__BpfLambdaGreaterThan;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaGreaterThan(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThan *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThan *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterThan;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaGreaterThan = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaGreaterThan", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThan), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaGreaterThan, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaGreaterOrEqualThan __pyx_vtable_4bpf4_4core__BpfLambdaGreaterOrEqualThan;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaGreaterOrEqualThan(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThan *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThan *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterOrEqualThan;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThan = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaGreaterOrEqualThan", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThan), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaGreaterOrEqualThan, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaGreaterThanConst __pyx_vtable_4bpf4_4core__BpfLambdaGreaterThanConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaGreaterThanConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThanConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThanConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterThanConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaGreaterThanConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaGreaterThanConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterThanConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaGreaterThanConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst __pyx_vtable_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaGreaterOrEqualThanConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLowerThan __pyx_vtable_4bpf4_4core__BpfLambdaLowerThan;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaLowerThan(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThan *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThan *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaLowerThan;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaLowerThan = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaLowerThan", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThan), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaLowerThan, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLowerThanConst __pyx_vtable_4bpf4_4core__BpfLambdaLowerThanConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaLowerThanConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThanConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThanConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaLowerThanConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaLowerThanConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaLowerThanConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaLowerThanConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaLowerThanConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLowerOrEqualThan __pyx_vtable_4bpf4_4core__BpfLambdaLowerOrEqualThan;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaLowerOrEqualThan(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThan *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThan *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaLowerOrEqualThan;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThan = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaLowerOrEqualThan", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThan), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaLowerOrEqualThan, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLowerOrEqualThanConst __pyx_vtable_4bpf4_4core__BpfLambdaLowerOrEqualThanConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaLowerOrEqualThanConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThanConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThanConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaLowerOrEqualThanConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThanConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaLowerOrEqualThanConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaLowerOrEqualThanConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaLowerOrEqualThanConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaEqual __pyx_vtable_4bpf4_4core__BpfLambdaEqual;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaEqual(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaEqual *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaEqual *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaEqual;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaEqual = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaEqual", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaEqual), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaEqual, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaEqualConst __pyx_vtable_4bpf4_4core__BpfLambdaEqualConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaEqualConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaEqualConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaEqualConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaEqualConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaEqualConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaEqualConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaEqualConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaEqualConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaUnequal __pyx_vtable_4bpf4_4core__BpfLambdaUnequal;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaUnequal(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaUnequal *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaUnequal *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaUnequal;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaUnequal = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaUnequal", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaUnequal), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_9_BpfBinOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaUnequal, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaUnequalConst __pyx_vtable_4bpf4_4core__BpfLambdaUnequalConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaUnequalConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaUnequalConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaUnequalConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaUnequalConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaUnequalConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaUnequalConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaUnequalConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaUnequalConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfMaxConst __pyx_vtable_4bpf4_4core__BpfMaxConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfMaxConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfMaxConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfMaxConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfMaxConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfMaxConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfMaxConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfMaxConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfMaxConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfMinConst __pyx_vtable_4bpf4_4core__BpfMinConst;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfMinConst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfMinConst *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfMinConst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfMinConst;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfMinConst = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfMinConst", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfMinConst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_14_BpfBinOpConst_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfMinConst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaLog __pyx_vtable_4bpf4_4core__BpfLambdaLog;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaLog(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaLog *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfBinOpConst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaLog *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaLog;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfLambdaLog[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaLog = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaLog", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaLog), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfBinOpConst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfLambdaLog(BpfInterface a, double b, tuple bounds, unicode op=u'')", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfBinOpConst, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfBinOpConst, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfLambdaLog, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_13_BpfLambdaLog_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaLog, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaRound __pyx_vtable_4bpf4_4core__BpfLambdaRound;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaRound(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaRound *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfUnaryOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaRound *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaRound;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaRound = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaRound", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaRound), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfUnaryOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfUnaryOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfUnaryOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_11_BpfUnaryOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaRound, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfRand __pyx_vtable_4bpf4_4core__BpfRand;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfRand(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfRand *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfUnaryOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfRand *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfRand;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfRand = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfRand", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfRand), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfUnaryOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfUnaryOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfUnaryOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_11_BpfUnaryOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfRand, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfM2F __pyx_vtable_4bpf4_4core__BpfM2F;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfM2F(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfM2F *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfUnaryOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfM2F *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfM2F;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfM2F = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfM2F", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfM2F), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfUnaryOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfUnaryOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfUnaryOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_11_BpfUnaryOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfM2F, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfF2M __pyx_vtable_4bpf4_4core__BpfF2M;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfF2M(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfF2M *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfUnaryOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfF2M *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfF2M;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__BpfF2M = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfF2M", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfF2M), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfUnaryOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfUnaryOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfUnaryOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_11_BpfUnaryOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfF2M, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__Bpf_db2amp __pyx_vtable_4bpf4_4core__Bpf_db2amp;

static PyObject *__pyx_tp_new_4bpf4_4core__Bpf_db2amp(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__Bpf_db2amp *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfUnaryOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__Bpf_db2amp *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__Bpf_db2amp;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__Bpf_db2amp = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._Bpf_db2amp", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__Bpf_db2amp), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfUnaryOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfUnaryOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfUnaryOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_11_BpfUnaryOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__Bpf_db2amp, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__Bpf_amp2db __pyx_vtable_4bpf4_4core__Bpf_amp2db;

static PyObject *__pyx_tp_new_4bpf4_4core__Bpf_amp2db(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__Bpf_amp2db *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__BpfUnaryOp(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__Bpf_amp2db *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__Bpf_amp2db;
  return o;
}

static PyTypeObject __pyx_type_4bpf4_4core__Bpf_amp2db = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._Bpf_amp2db", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__Bpf_amp2db), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfUnaryOp, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfUnaryOp, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfUnaryOp, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_11_BpfUnaryOp_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__Bpf_amp2db, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfLambdaClip __pyx_vtable_4bpf4_4core__BpfLambdaClip;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfLambdaClip(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaClip *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfLambdaClip *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfLambdaClip;
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfLambdaClip(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfLambdaClip *p = (struct __pyx_obj_4bpf4_4core__BpfLambdaClip *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->bpf);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfLambdaClip(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfLambdaClip *p = (struct __pyx_obj_4bpf4_4core__BpfLambdaClip *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfLambdaClip)); if (e) return e;
  if (p->bpf) {
    e = (*v)(((PyObject *)p->bpf), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfLambdaClip(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfLambdaClip *p = (struct __pyx_obj_4bpf4_4core__BpfLambdaClip *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfLambdaClip);
  tmp = ((PyObject*)p->bpf);
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfLambdaClip[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfLambdaClip_3__reduce__, METH_NOARGS, __pyx_doc_4bpf4_4core_14_BpfLambdaClip_2__reduce__},
  {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfLambdaClip_5__setstate__, METH_O, __pyx_doc_4bpf4_4core_14_BpfLambdaClip_4__setstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfLambdaClip = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfLambdaClip", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfLambdaClip), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfLambdaClip, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfLambdaClip, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfLambdaClip, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfLambdaClip, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfLambdaClip, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfDeriv __pyx_vtable_4bpf4_4core__BpfDeriv;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfDeriv(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfDeriv *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfDeriv *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfDeriv;
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfDeriv(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfDeriv *p = (struct __pyx_obj_4bpf4_4core__BpfDeriv *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->bpf);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfDeriv(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfDeriv *p = (struct __pyx_obj_4bpf4_4core__BpfDeriv *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfDeriv)); if (e) return e;
  if (p->bpf) {
    e = (*v)(((PyObject *)p->bpf), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfDeriv(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfDeriv *p = (struct __pyx_obj_4bpf4_4core__BpfDeriv *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfDeriv);
  tmp = ((PyObject*)p->bpf);
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfDeriv[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_9_BpfDeriv_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_9_BpfDeriv_2__getstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfDeriv = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfDeriv", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfDeriv), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfDeriv, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfDeriv(BpfInterface bpf, double h=0)\n\n    A bpf representing the derivative of another bpf\n\n    The derivative at a point x is the forward derivative: `d = (f(x) + f(x+h)) / 2`\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfDeriv, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfDeriv, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfDeriv, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_9_BpfDeriv_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfDeriv, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfInverted __pyx_vtable_4bpf4_4core__BpfInverted;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfInverted(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfInverted *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfInverted *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfInverted;
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfInverted(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfInverted *p = (struct __pyx_obj_4bpf4_4core__BpfInverted *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->bpf);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfInverted(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfInverted *p = (struct __pyx_obj_4bpf4_4core__BpfInverted *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfInverted)); if (e) return e;
  if (p->bpf) {
    e = (*v)(((PyObject *)p->bpf), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfInverted(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfInverted *p = (struct __pyx_obj_4bpf4_4core__BpfInverted *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfInverted);
  tmp = ((PyObject*)p->bpf);
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfInverted[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_12_BpfInverted_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_12_BpfInverted_2__getstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfInverted = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfInverted", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfInverted), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfInverted, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfInverted(BpfInterface bpf)", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfInverted, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfInverted, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfInverted, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_12_BpfInverted_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfInverted, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfIntegrate __pyx_vtable_4bpf4_4core__BpfIntegrate;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfIntegrate(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfIntegrate *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfIntegrate *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfIntegrate;
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfIntegrate(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfIntegrate *p = (struct __pyx_obj_4bpf4_4core__BpfIntegrate *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->bpf);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfIntegrate(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfIntegrate *p = (struct __pyx_obj_4bpf4_4core__BpfIntegrate *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfIntegrate)); if (e) return e;
  if (p->bpf) {
    e = (*v)(((PyObject *)p->bpf), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfIntegrate(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfIntegrate *p = (struct __pyx_obj_4bpf4_4core__BpfIntegrate *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfIntegrate);
  tmp = ((PyObject*)p->bpf);
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_4bpf4_4core_13_BpfIntegrate_debug(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_13_BpfIntegrate_5debug_1__get__(o);
}

static int __pyx_setprop_4bpf4_4core_13_BpfIntegrate_debug(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4bpf4_4core_13_BpfIntegrate_5debug_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_4bpf4_4core_13_BpfIntegrate_oversample(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_13_BpfIntegrate_10oversample_1__get__(o);
}

static int __pyx_setprop_4bpf4_4core_13_BpfIntegrate_oversample(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_4bpf4_4core_13_BpfIntegrate_10oversample_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfIntegrate[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_13_BpfIntegrate_7__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_13_BpfIntegrate_6__getstate__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4bpf4_4core__BpfIntegrate[] = {
  {(char *)"debug", __pyx_getprop_4bpf4_4core_13_BpfIntegrate_debug, __pyx_setprop_4bpf4_4core_13_BpfIntegrate_debug, (char *)"debug: 'int'", 0},
  {(char *)"oversample", __pyx_getprop_4bpf4_4core_13_BpfIntegrate_oversample, __pyx_setprop_4bpf4_4core_13_BpfIntegrate_oversample, (char *)"oversample: 'size_t'", 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfIntegrate = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfIntegrate", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfIntegrate), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfIntegrate, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfIntegrate(BpfInterface bpf, N=None, bounds=None, double min_N_ratio=0.3, double Nexp=0.8, int oversample=0)\n\n    A bpf representing the integration of another bpf\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfIntegrate, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfIntegrate, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfIntegrate, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4bpf4_4core__BpfIntegrate, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_13_BpfIntegrate_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfIntegrate, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfPeriodic __pyx_vtable_4bpf4_4core__BpfPeriodic;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfPeriodic(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfPeriodic *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfPeriodic *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfPeriodic;
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfPeriodic(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfPeriodic *p = (struct __pyx_obj_4bpf4_4core__BpfPeriodic *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->bpf);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfPeriodic(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfPeriodic *p = (struct __pyx_obj_4bpf4_4core__BpfPeriodic *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfPeriodic)); if (e) return e;
  if (p->bpf) {
    e = (*v)(((PyObject *)p->bpf), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfPeriodic(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfPeriodic *p = (struct __pyx_obj_4bpf4_4core__BpfPeriodic *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfPeriodic);
  tmp = ((PyObject*)p->bpf);
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfPeriodic[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_12_BpfPeriodic_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_12_BpfPeriodic_2__getstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfPeriodic = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfPeriodic", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfPeriodic), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfPeriodic, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfPeriodic(BpfInterface bpf)", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfPeriodic, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfPeriodic, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfPeriodic, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_12_BpfPeriodic_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfPeriodic, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfProjection __pyx_vtable_4bpf4_4core__BpfProjection;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfProjection(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfProjection *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfProjection *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfProjection;
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfProjection(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfProjection *p = (struct __pyx_obj_4bpf4_4core__BpfProjection *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->bpf);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfProjection(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfProjection *p = (struct __pyx_obj_4bpf4_4core__BpfProjection *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfProjection)); if (e) return e;
  if (p->bpf) {
    e = (*v)(((PyObject *)p->bpf), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfProjection(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfProjection *p = (struct __pyx_obj_4bpf4_4core__BpfProjection *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfProjection);
  tmp = ((PyObject*)p->bpf);
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_4bpf4_4core_14_BpfProjection_dx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_14_BpfProjection_2dx_1__get__(o);
}

static PyObject *__pyx_getprop_4bpf4_4core_14_BpfProjection_rx(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_14_BpfProjection_2rx_1__get__(o);
}

static PyObject *__pyx_getprop_4bpf4_4core_14_BpfProjection_offset(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_14_BpfProjection_6offset_1__get__(o);
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfProjection[] = {
  {"fixpoint", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfProjection_3fixpoint, METH_NOARGS, __pyx_doc_4bpf4_4core_14_BpfProjection_2fixpoint},
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_14_BpfProjection_5__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_14_BpfProjection_4__getstate__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4bpf4_4core__BpfProjection[] = {
  {(char *)"dx", __pyx_getprop_4bpf4_4core_14_BpfProjection_dx, 0, (char *)0, 0},
  {(char *)"rx", __pyx_getprop_4bpf4_4core_14_BpfProjection_rx, 0, (char *)0, 0},
  {(char *)"offset", __pyx_getprop_4bpf4_4core_14_BpfProjection_offset, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfProjection = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfProjection", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfProjection), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfProjection, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfProjection(BpfInterface bpf, double rx, double dx=0, double offset=0, bounds=None)", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfProjection, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfProjection, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfProjection, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4bpf4_4core__BpfProjection, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_14_BpfProjection_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfProjection, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfKeepSlope __pyx_vtable_4bpf4_4core__BpfKeepSlope;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfKeepSlope(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfKeepSlope *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfKeepSlope *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfKeepSlope;
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfKeepSlope(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfKeepSlope *p = (struct __pyx_obj_4bpf4_4core__BpfKeepSlope *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->bpf);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfKeepSlope(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfKeepSlope *p = (struct __pyx_obj_4bpf4_4core__BpfKeepSlope *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfKeepSlope)); if (e) return e;
  if (p->bpf) {
    e = (*v)(((PyObject *)p->bpf), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfKeepSlope(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfKeepSlope *p = (struct __pyx_obj_4bpf4_4core__BpfKeepSlope *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfKeepSlope);
  tmp = ((PyObject*)p->bpf);
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfKeepSlope[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_13_BpfKeepSlope_3__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_13_BpfKeepSlope_2__getstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfKeepSlope = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfKeepSlope", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfKeepSlope), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfKeepSlope, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfKeepSlope(BpfInterface bpf, double EPSILON=0.0001)", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfKeepSlope, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfKeepSlope, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfKeepSlope, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_13_BpfKeepSlope_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfKeepSlope, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfCrop __pyx_vtable_4bpf4_4core__BpfCrop;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfCrop(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfCrop *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfCrop *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfCrop;
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfCrop(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfCrop *p = (struct __pyx_obj_4bpf4_4core__BpfCrop *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->bpf);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfCrop(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfCrop *p = (struct __pyx_obj_4bpf4_4core__BpfCrop *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__BpfCrop)); if (e) return e;
  if (p->bpf) {
    e = (*v)(((PyObject *)p->bpf), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfCrop(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfCrop *p = (struct __pyx_obj_4bpf4_4core__BpfCrop *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__BpfCrop);
  tmp = ((PyObject*)p->bpf);
  p->bpf = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_4bpf4_4core_8_BpfCrop__y0(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_8_BpfCrop_3_y0_1__get__(o);
}

static PyObject *__pyx_getprop_4bpf4_4core_8_BpfCrop__y1(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_8_BpfCrop_3_y1_1__get__(o);
}

static PyObject *__pyx_getprop_4bpf4_4core_8_BpfCrop_outbound_mode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_4bpf4_4core_8_BpfCrop_13outbound_mode_1__get__(o);
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfCrop[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_4bpf4_4core_8_BpfCrop_1__reduce__, METH_NOARGS, __pyx_doc_4bpf4_4core_8_BpfCrop___reduce__},
  {"__setstate__", (PyCFunction)__pyx_pw_4bpf4_4core_8_BpfCrop_3__setstate__, METH_O, __pyx_doc_4bpf4_4core_8_BpfCrop_2__setstate__},
  {"outbound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4bpf4_4core_8_BpfCrop_7outbound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4bpf4_4core_8_BpfCrop_6outbound},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4bpf4_4core__BpfCrop[] = {
  {(char *)"_y0", __pyx_getprop_4bpf4_4core_8_BpfCrop__y0, 0, (char *)0, 0},
  {(char *)"_y1", __pyx_getprop_4bpf4_4core_8_BpfCrop__y1, 0, (char *)0, 0},
  {(char *)"outbound_mode", __pyx_getprop_4bpf4_4core_8_BpfCrop_outbound_mode, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfCrop = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfCrop", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfCrop), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfCrop, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfCrop, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfCrop, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfCrop, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_4bpf4_4core__BpfCrop, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfCrop, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__MultipleBpfs __pyx_vtable_4bpf4_4core__MultipleBpfs;

static PyObject *__pyx_tp_new_4bpf4_4core__MultipleBpfs(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__MultipleBpfs *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core_BpfInterface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__MultipleBpfs *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__MultipleBpfs;
  p->_bpfs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->tmp = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__MultipleBpfs(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__MultipleBpfs *p = (struct __pyx_obj_4bpf4_4core__MultipleBpfs *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_4bpf4_4core_13_MultipleBpfs_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_bpfs);
  Py_CLEAR(p->tmp);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core_BpfInterface(o);
}

static int __pyx_tp_traverse_4bpf4_4core__MultipleBpfs(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__MultipleBpfs *p = (struct __pyx_obj_4bpf4_4core__MultipleBpfs *)o;
  e = ((likely(__pyx_ptype_4bpf4_4core_BpfInterface)) ? ((__pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse) ? __pyx_ptype_4bpf4_4core_BpfInterface->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4bpf4_4core__MultipleBpfs)); if (e) return e;
  if (p->_bpfs) {
    e = (*v)(p->_bpfs, a); if (e) return e;
  }
  if (p->tmp) {
    e = (*v)(((PyObject *)p->tmp), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__MultipleBpfs(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__MultipleBpfs *p = (struct __pyx_obj_4bpf4_4core__MultipleBpfs *)o;
  if (likely(__pyx_ptype_4bpf4_4core_BpfInterface)) { if (__pyx_ptype_4bpf4_4core_BpfInterface->tp_clear) __pyx_ptype_4bpf4_4core_BpfInterface->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4bpf4_4core__MultipleBpfs);
  tmp = ((PyObject*)p->_bpfs);
  p->_bpfs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->tmp);
  p->tmp = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__MultipleBpfs[] = {
  {"_calculate_bounds", (PyCFunction)__pyx_pw_4bpf4_4core_13_MultipleBpfs_5_calculate_bounds, METH_NOARGS, __pyx_doc_4bpf4_4core_13_MultipleBpfs_4_calculate_bounds},
  {"__getstate__", (PyCFunction)__pyx_pw_4bpf4_4core_13_MultipleBpfs_7__getstate__, METH_NOARGS, __pyx_doc_4bpf4_4core_13_MultipleBpfs_6__getstate__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__MultipleBpfs = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._MultipleBpfs", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__MultipleBpfs), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__MultipleBpfs, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_MultipleBpfs(bpfs)", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__MultipleBpfs, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__MultipleBpfs, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__MultipleBpfs, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_13_MultipleBpfs_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__MultipleBpfs, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Max __pyx_vtable_4bpf4_4core_Max;

static PyObject *__pyx_tp_new_4bpf4_4core_Max(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Max *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__MultipleBpfs(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Max *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Max;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core_Max[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Max = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Max", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Max), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__MultipleBpfs, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Max(*bpfs)\n\n    A bpf which returns the max of multiple bpfs at a given point\n\n    ```python\n    a = linear(0, 0, 1, 0.5, 2, 0)\n    b = expon(0, 0, 2, 1, exp=3)\n    a.plot(show=False, color=\"red\", linewidth=4, alpha=0.3)\n    b.plot(show=False, color=\"blue\", linewidth=4, alpha=0.3)\n    core.Max((a, b)).plot(color=\"black\", linewidth=4, alpha=0.8, linestyle='dotted')\n    ```\n    ![](assets/Max.png)\n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__MultipleBpfs, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__MultipleBpfs, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Max, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_3Max_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Max, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core_Min __pyx_vtable_4bpf4_4core_Min;

static PyObject *__pyx_tp_new_4bpf4_4core_Min(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core_Min *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__MultipleBpfs(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core_Min *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core_Min;
  return o;
}

static PyMethodDef __pyx_methods_4bpf4_4core_Min[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core_Min = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Min", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core_Min), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__MultipleBpfs, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Min(*bpfs)\n\n    A bpf which returns the min of multiple bpfs at a given point\n\n    ```python\n    a = linear(0, 0, 1, 0.5, 2, 0)\n    b = expon(0, 0, 2, 1, exp=3)\n    a.plot(show=False, color=\"red\", linewidth=4, alpha=0.3)\n    b.plot(show=False, color=\"blue\", linewidth=4, alpha=0.3)\n    core.Min((a, b)).plot(color=\"black\", linewidth=4, alpha=0.8, linestyle='dotted')\n    ```\n    ![](assets/Min.png)\n    \n    ", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__MultipleBpfs, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__MultipleBpfs, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core_Min, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_3Min_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core_Min, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_4bpf4_4core__BpfSelect __pyx_vtable_4bpf4_4core__BpfSelect;

static PyObject *__pyx_tp_new_4bpf4_4core__BpfSelect(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_4bpf4_4core__BpfSelect *p;
  PyObject *o = __pyx_tp_new_4bpf4_4core__MultipleBpfs(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_4bpf4_4core__BpfSelect *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4bpf4_4core_BpfInterface*)__pyx_vtabptr_4bpf4_4core__BpfSelect;
  p->which = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core__BpfSelect(PyObject *o) {
  struct __pyx_obj_4bpf4_4core__BpfSelect *p = (struct __pyx_obj_4bpf4_4core__BpfSelect *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->which);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_4bpf4_4core__MultipleBpfs(o);
}

static int __pyx_tp_traverse_4bpf4_4core__BpfSelect(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core__BpfSelect *p = (struct __pyx_obj_4bpf4_4core__BpfSelect *)o;
  e = __pyx_tp_traverse_4bpf4_4core__MultipleBpfs(o, v, a); if (e) return e;
  if (p->which) {
    e = (*v)(((PyObject *)p->which), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_4bpf4_4core__BpfSelect(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_4bpf4_4core__BpfSelect *p = (struct __pyx_obj_4bpf4_4core__BpfSelect *)o;
  __pyx_tp_clear_4bpf4_4core__MultipleBpfs(o);
  tmp = ((PyObject*)p->which);
  p->which = ((struct __pyx_obj_4bpf4_4core_BpfInterface *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_4bpf4_4core__BpfSelect[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_4bpf4_4core__BpfSelect = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._BpfSelect", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core__BpfSelect), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core__BpfSelect, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_145__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_4bpf4_4core_12BpfInterface_117__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "_BpfSelect(which, bpfs, shape=u'linear')", /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core__BpfSelect, /*tp_traverse*/
  __pyx_tp_clear_4bpf4_4core__BpfSelect, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_4bpf4_4core__BpfSelect, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_4bpf4_4core_10_BpfSelect_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core__BpfSelect, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments *__pyx_freelist_4bpf4_4core___pyx_scope_struct__segments[8];
static int __pyx_freecount_4bpf4_4core___pyx_scope_struct__segments = 0;

static PyObject *__pyx_tp_new_4bpf4_4core___pyx_scope_struct__segments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4bpf4_4core___pyx_scope_struct__segments > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments)))) {
    o = (PyObject*)__pyx_freelist_4bpf4_4core___pyx_scope_struct__segments[--__pyx_freecount_4bpf4_4core___pyx_scope_struct__segments];
    memset(o, 0, sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core___pyx_scope_struct__segments(PyObject *o) {
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments *p = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_interpoltype);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4bpf4_4core___pyx_scope_struct__segments < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments)))) {
    __pyx_freelist_4bpf4_4core___pyx_scope_struct__segments[__pyx_freecount_4bpf4_4core___pyx_scope_struct__segments++] = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_4bpf4_4core___pyx_scope_struct__segments(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments *p = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments *)o;
  if (p->__pyx_v_interpoltype) {
    e = (*v)(p->__pyx_v_interpoltype, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_4bpf4_4core___pyx_scope_struct__segments = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.__pyx_scope_struct__segments", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct__segments), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core___pyx_scope_struct__segments, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core___pyx_scope_struct__segments, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core___pyx_scope_struct__segments, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments *__pyx_freelist_4bpf4_4core___pyx_scope_struct_1_segments[8];
static int __pyx_freecount_4bpf4_4core___pyx_scope_struct_1_segments = 0;

static PyObject *__pyx_tp_new_4bpf4_4core___pyx_scope_struct_1_segments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4bpf4_4core___pyx_scope_struct_1_segments > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments)))) {
    o = (PyObject*)__pyx_freelist_4bpf4_4core___pyx_scope_struct_1_segments[--__pyx_freecount_4bpf4_4core___pyx_scope_struct_1_segments];
    memset(o, 0, sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core___pyx_scope_struct_1_segments(PyObject *o) {
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments *p = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_descr);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4bpf4_4core___pyx_scope_struct_1_segments < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments)))) {
    __pyx_freelist_4bpf4_4core___pyx_scope_struct_1_segments[__pyx_freecount_4bpf4_4core___pyx_scope_struct_1_segments++] = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_4bpf4_4core___pyx_scope_struct_1_segments(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments *p = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments *)o;
  if (p->__pyx_v_descr) {
    e = (*v)(p->__pyx_v_descr, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_4bpf4_4core___pyx_scope_struct_1_segments = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.__pyx_scope_struct_1_segments", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_1_segments), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core___pyx_scope_struct_1_segments, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core___pyx_scope_struct_1_segments, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core___pyx_scope_struct_1_segments, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments *__pyx_freelist_4bpf4_4core___pyx_scope_struct_2_segments[8];
static int __pyx_freecount_4bpf4_4core___pyx_scope_struct_2_segments = 0;

static PyObject *__pyx_tp_new_4bpf4_4core___pyx_scope_struct_2_segments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4bpf4_4core___pyx_scope_struct_2_segments > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments)))) {
    o = (PyObject*)__pyx_freelist_4bpf4_4core___pyx_scope_struct_2_segments[--__pyx_freecount_4bpf4_4core___pyx_scope_struct_2_segments];
    memset(o, 0, sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core___pyx_scope_struct_2_segments(PyObject *o) {
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments *p = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_interpoltype);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4bpf4_4core___pyx_scope_struct_2_segments < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments)))) {
    __pyx_freelist_4bpf4_4core___pyx_scope_struct_2_segments[__pyx_freecount_4bpf4_4core___pyx_scope_struct_2_segments++] = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_4bpf4_4core___pyx_scope_struct_2_segments(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments *p = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments *)o;
  if (p->__pyx_v_interpoltype) {
    e = (*v)(p->__pyx_v_interpoltype, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_4bpf4_4core___pyx_scope_struct_2_segments = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.__pyx_scope_struct_2_segments", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_2_segments), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core___pyx_scope_struct_2_segments, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core___pyx_scope_struct_2_segments, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core___pyx_scope_struct_2_segments, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments *__pyx_freelist_4bpf4_4core___pyx_scope_struct_3_segments[8];
static int __pyx_freecount_4bpf4_4core___pyx_scope_struct_3_segments = 0;

static PyObject *__pyx_tp_new_4bpf4_4core___pyx_scope_struct_3_segments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4bpf4_4core___pyx_scope_struct_3_segments > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments)))) {
    o = (PyObject*)__pyx_freelist_4bpf4_4core___pyx_scope_struct_3_segments[--__pyx_freecount_4bpf4_4core___pyx_scope_struct_3_segments];
    memset(o, 0, sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core___pyx_scope_struct_3_segments(PyObject *o) {
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments *p = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_interpoltype);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4bpf4_4core___pyx_scope_struct_3_segments < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments)))) {
    __pyx_freelist_4bpf4_4core___pyx_scope_struct_3_segments[__pyx_freecount_4bpf4_4core___pyx_scope_struct_3_segments++] = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_4bpf4_4core___pyx_scope_struct_3_segments(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments *p = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments *)o;
  if (p->__pyx_v_interpoltype) {
    e = (*v)(p->__pyx_v_interpoltype, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_4bpf4_4core___pyx_scope_struct_3_segments = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.__pyx_scope_struct_3_segments", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_3_segments), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core___pyx_scope_struct_3_segments, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core___pyx_scope_struct_3_segments, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core___pyx_scope_struct_3_segments, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments *__pyx_freelist_4bpf4_4core___pyx_scope_struct_4_segments[8];
static int __pyx_freecount_4bpf4_4core___pyx_scope_struct_4_segments = 0;

static PyObject *__pyx_tp_new_4bpf4_4core___pyx_scope_struct_4_segments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4bpf4_4core___pyx_scope_struct_4_segments > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments)))) {
    o = (PyObject*)__pyx_freelist_4bpf4_4core___pyx_scope_struct_4_segments[--__pyx_freecount_4bpf4_4core___pyx_scope_struct_4_segments];
    memset(o, 0, sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_4bpf4_4core___pyx_scope_struct_4_segments(PyObject *o) {
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments *p = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4bpf4_4core___pyx_scope_struct_4_segments < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments)))) {
    __pyx_freelist_4bpf4_4core___pyx_scope_struct_4_segments[__pyx_freecount_4bpf4_4core___pyx_scope_struct_4_segments++] = ((struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_4bpf4_4core___pyx_scope_struct_4_segments(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments *p = (struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_4bpf4_4core___pyx_scope_struct_4_segments = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.__pyx_scope_struct_4_segments", /*tp_name*/
  sizeof(struct __pyx_obj_4bpf4_4core___pyx_scope_struct_4_segments), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_4bpf4_4core___pyx_scope_struct_4_segments, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_4bpf4_4core___pyx_scope_struct_4_segments, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_4bpf4_4core___pyx_scope_struct_4_segments, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py[8];
static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py = 0;

static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py)))) {
    o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py];
    memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py));
    (void) PyObject_INIT(o, t);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py(PyObject *o) {
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py)))) {
    __pyx_freelist___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyTypeObject __pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.__pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py", /*tp_name*/
  sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_array __pyx_vtable_array;

static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_array_obj *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_array_obj *)o);
  p->__pyx_vtab = __pyx_vtabptr_array;
  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_array(PyObject *o) {
  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_array___dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->mode);
  Py_CLEAR(p->_format);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_array___setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_array___getattr__(o, n);
  }
  return v;
}

static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}

static PyMethodDef __pyx_methods_array[] = {
  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_array[] = {
  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_array = {
  __pyx_array___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_array, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_array = {
  __pyx_array___len__, /*mp_length*/
  __pyx_array___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_array = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_array_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type___pyx_array = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.array", /*tp_name*/
  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  __pyx_tp_getattro_array, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_array, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_array, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_MemviewEnum_obj *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_MemviewEnum_obj *)o);
  p->name = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_Enum(PyObject *o) {
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->name);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  if (p->name) {
    e = (*v)(p->name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_Enum(PyObject *o) {
  PyObject* tmp;
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  tmp = ((PyObject*)p->name);
  p->name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_Enum[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type___pyx_MemviewEnum = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.Enum", /*tp_name*/
  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_MemviewEnum___repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_Enum, /*tp_traverse*/
  __pyx_tp_clear_Enum, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_Enum, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_MemviewEnum___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_Enum, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;

static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_memoryview_obj *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_memoryview_obj *)o);
  p->__pyx_vtab = __pyx_vtabptr_memoryview;
  p->obj = Py_None; Py_INCREF(Py_None);
  p->_size = Py_None; Py_INCREF(Py_None);
  p->_array_interface = Py_None; Py_INCREF(Py_None);
  p->view.obj = NULL;
  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_memoryview(PyObject *o) {
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_memoryview___dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->obj);
  Py_CLEAR(p->_size);
  Py_CLEAR(p->_array_interface);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  if (p->obj) {
    e = (*v)(p->obj, a); if (e) return e;
  }
  if (p->_size) {
    e = (*v)(p->_size, a); if (e) return e;
  }
  if (p->_array_interface) {
    e = (*v)(p->_array_interface, a); if (e) return e;
  }
  if (p->view.obj) {
    e = (*v)(p->view.obj, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_memoryview(PyObject *o) {
  PyObject* tmp;
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  tmp = ((PyObject*)p->obj);
  p->obj = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_size);
  p->_size = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_array_interface);
  p->_array_interface = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  Py_CLEAR(p->view.obj);
  return 0;
}
static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_memoryview___setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}

static PyMethodDef __pyx_methods_memoryview[] = {
  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_memoryview[] = {
  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
  __pyx_memoryview___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_memoryview, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
  __pyx_memoryview___len__, /*mp_length*/
  __pyx_memoryview___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type___pyx_memoryview = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core.memoryview", /*tp_name*/
  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_memoryview___repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_memoryview___str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_memoryview, /*tp_traverse*/
  __pyx_tp_clear_memoryview, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_memoryview, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_memoryview, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_memoryview, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};
static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;

static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_memoryviewslice_obj *p;
  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_memoryviewslice_obj *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
  p->from_object = Py_None; Py_INCREF(Py_None);
  p->from_slice.memview = NULL;
  return o;
}

static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_memoryviewslice___dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->from_object);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_memoryview(o);
}

static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
  if (p->from_object) {
    e = (*v)(p->from_object, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
  PyObject* tmp;
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  __pyx_tp_clear_memoryview(o);
  tmp = ((PyObject*)p->from_object);
  p->from_object = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
  return 0;
}

static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
}

static PyMethodDef __pyx_methods__memoryviewslice[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type___pyx_memoryviewslice = {
  PyVarObject_HEAD_INIT(0, 0)
  "bpf4.core._memoryviewslice", /*tp_name*/
  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_memoryview___repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_memoryview___str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Internal class for passing memoryview slices to Python", /*tp_doc*/
  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods__memoryviewslice, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets__memoryviewslice, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new__memoryviewslice, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_core(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_core},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "core",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_kp_u_BPFs_accept_only_slices_not_sing, __pyx_k_BPFs_accept_only_slices_not_sing, sizeof(__pyx_k_BPFs_accept_only_slices_not_sing), 0, 1, 0, 0},
  {&__pyx_n_s_BpfBase, __pyx_k_BpfBase, sizeof(__pyx_k_BpfBase), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBase___getstate, __pyx_k_BpfBase___getstate, sizeof(__pyx_k_BpfBase___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBase___setstate, __pyx_k_BpfBase___setstate, sizeof(__pyx_k_BpfBase___setstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBase__mapn_between, __pyx_k_BpfBase__mapn_between, sizeof(__pyx_k_BpfBase__mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBase_clone_with_new_data, __pyx_k_BpfBase_clone_with_new_data, sizeof(__pyx_k_BpfBase_clone_with_new_data), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBase_insertpoint, __pyx_k_BpfBase_insertpoint, sizeof(__pyx_k_BpfBase_insertpoint), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBase_mapn_between, __pyx_k_BpfBase_mapn_between, sizeof(__pyx_k_BpfBase_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBase_outbound, __pyx_k_BpfBase_outbound, sizeof(__pyx_k_BpfBase_outbound), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBase_points, __pyx_k_BpfBase_points, sizeof(__pyx_k_BpfBase_points), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfBase_points_line_2246, __pyx_k_BpfBase_points_line_2246, sizeof(__pyx_k_BpfBase_points_line_2246), 0, 1, 0, 0},
  {&__pyx_n_s_BpfBase_removepoint, __pyx_k_BpfBase_removepoint, sizeof(__pyx_k_BpfBase_removepoint), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBase_segments, __pyx_k_BpfBase_segments, sizeof(__pyx_k_BpfBase_segments), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBase_shift, __pyx_k_BpfBase_shift, sizeof(__pyx_k_BpfBase_shift), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBase_stretch, __pyx_k_BpfBase_stretch, sizeof(__pyx_k_BpfBase_stretch), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBinOp, __pyx_k_BpfBinOp, sizeof(__pyx_k_BpfBinOp), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBinOpConst, __pyx_k_BpfBinOpConst, sizeof(__pyx_k_BpfBinOpConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBinOpConst___getstate, __pyx_k_BpfBinOpConst___getstate, sizeof(__pyx_k_BpfBinOpConst___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBinOpConst__get_xs_for_rende, __pyx_k_BpfBinOpConst__get_xs_for_rende, sizeof(__pyx_k_BpfBinOpConst__get_xs_for_rende), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBinOpConst_map, __pyx_k_BpfBinOpConst_map, sizeof(__pyx_k_BpfBinOpConst_map), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBinOp___getstate, __pyx_k_BpfBinOp___getstate, sizeof(__pyx_k_BpfBinOp___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBinOp__get_xs_for_rendering, __pyx_k_BpfBinOp__get_xs_for_rendering, sizeof(__pyx_k_BpfBinOp__get_xs_for_rendering), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBinOp_map, __pyx_k_BpfBinOp_map, sizeof(__pyx_k_BpfBinOp_map), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBinOp_mapn_between, __pyx_k_BpfBinOp_mapn_between, sizeof(__pyx_k_BpfBinOp_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBlend, __pyx_k_BpfBlend, sizeof(__pyx_k_BpfBlend), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBlendConst, __pyx_k_BpfBlendConst, sizeof(__pyx_k_BpfBlendConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBlendConst___getstate, __pyx_k_BpfBlendConst___getstate, sizeof(__pyx_k_BpfBlendConst___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfBlend___getstate, __pyx_k_BpfBlend___getstate, sizeof(__pyx_k_BpfBlend___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfCompose, __pyx_k_BpfCompose, sizeof(__pyx_k_BpfCompose), 0, 0, 1, 1},
  {&__pyx_n_s_BpfCompose___getstate, __pyx_k_BpfCompose___getstate, sizeof(__pyx_k_BpfCompose___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfCompose___setstate, __pyx_k_BpfCompose___setstate, sizeof(__pyx_k_BpfCompose___setstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfCompose_mapn_between, __pyx_k_BpfCompose_mapn_between, sizeof(__pyx_k_BpfCompose_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfConcat, __pyx_k_BpfConcat, sizeof(__pyx_k_BpfConcat), 0, 0, 1, 1},
  {&__pyx_n_s_BpfConcat2, __pyx_k_BpfConcat2, sizeof(__pyx_k_BpfConcat2), 0, 0, 1, 1},
  {&__pyx_n_s_BpfConcat2___getstate, __pyx_k_BpfConcat2___getstate, sizeof(__pyx_k_BpfConcat2___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfConcat2___setstate, __pyx_k_BpfConcat2___setstate, sizeof(__pyx_k_BpfConcat2___setstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfConcat___getstate, __pyx_k_BpfConcat___getstate, sizeof(__pyx_k_BpfConcat___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfConcat_concat, __pyx_k_BpfConcat_concat, sizeof(__pyx_k_BpfConcat_concat), 0, 0, 1, 1},
  {&__pyx_n_s_BpfCrop, __pyx_k_BpfCrop, sizeof(__pyx_k_BpfCrop), 0, 0, 1, 1},
  {&__pyx_n_s_BpfCrop___reduce, __pyx_k_BpfCrop___reduce, sizeof(__pyx_k_BpfCrop___reduce), 0, 0, 1, 1},
  {&__pyx_n_s_BpfCrop___setstate, __pyx_k_BpfCrop___setstate, sizeof(__pyx_k_BpfCrop___setstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfCrop_integrate_between, __pyx_k_BpfCrop_integrate_between, sizeof(__pyx_k_BpfCrop_integrate_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfCrop_mapn_between, __pyx_k_BpfCrop_mapn_between, sizeof(__pyx_k_BpfCrop_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfCrop_new, __pyx_k_BpfCrop_new, sizeof(__pyx_k_BpfCrop_new), 0, 0, 1, 1},
  {&__pyx_n_s_BpfCrop_outbound, __pyx_k_BpfCrop_outbound, sizeof(__pyx_k_BpfCrop_outbound), 0, 0, 1, 1},
  {&__pyx_n_s_BpfCrop_outbound_set, __pyx_k_BpfCrop_outbound_set, sizeof(__pyx_k_BpfCrop_outbound_set), 0, 0, 1, 1},
  {&__pyx_n_s_BpfDeriv, __pyx_k_BpfDeriv, sizeof(__pyx_k_BpfDeriv), 0, 0, 1, 1},
  {&__pyx_n_s_BpfDeriv___getstate, __pyx_k_BpfDeriv___getstate, sizeof(__pyx_k_BpfDeriv___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfF2M, __pyx_k_BpfF2M, sizeof(__pyx_k_BpfF2M), 0, 0, 1, 1},
  {&__pyx_n_s_BpfIntegrate, __pyx_k_BpfIntegrate, sizeof(__pyx_k_BpfIntegrate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfIntegrate___getstate, __pyx_k_BpfIntegrate___getstate, sizeof(__pyx_k_BpfIntegrate___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfIntegrate_derivative, __pyx_k_BpfIntegrate_derivative, sizeof(__pyx_k_BpfIntegrate_derivative), 0, 0, 1, 1},
  {&__pyx_n_s_BpfIntegrate_mapn_between, __pyx_k_BpfIntegrate_mapn_between, sizeof(__pyx_k_BpfIntegrate_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface, __pyx_k_BpfInterface, sizeof(__pyx_k_BpfInterface), 0, 0, 1, 1},
  {&__pyx_n_u_BpfInterface, __pyx_k_BpfInterface, sizeof(__pyx_k_BpfInterface), 0, 1, 0, 1},
  {&__pyx_n_s_BpfInterface___reduce, __pyx_k_BpfInterface___reduce, sizeof(__pyx_k_BpfInterface___reduce), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface__asbpf, __pyx_k_BpfInterface__asbpf, sizeof(__pyx_k_BpfInterface__asbpf), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface__get_points_for_ren, __pyx_k_BpfInterface__get_points_for_ren, sizeof(__pyx_k_BpfInterface__get_points_for_ren), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface__slice, __pyx_k_BpfInterface__slice, sizeof(__pyx_k_BpfInterface__slice), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_abs, __pyx_k_BpfInterface_abs, sizeof(__pyx_k_BpfInterface_abs), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_acos, __pyx_k_BpfInterface_acos, sizeof(__pyx_k_BpfInterface_acos), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_amp2db, __pyx_k_BpfInterface_amp2db, sizeof(__pyx_k_BpfInterface_amp2db), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_amp2db_line_1324, __pyx_k_BpfInterface_amp2db_line_1324, sizeof(__pyx_k_BpfInterface_amp2db_line_1324), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_apply, __pyx_k_BpfInterface_apply, sizeof(__pyx_k_BpfInterface_apply), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_apply_line_1691, __pyx_k_BpfInterface_apply_line_1691, sizeof(__pyx_k_BpfInterface_apply_line_1691), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_asin, __pyx_k_BpfInterface_asin, sizeof(__pyx_k_BpfInterface_asin), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_bounds, __pyx_k_BpfInterface_bounds, sizeof(__pyx_k_BpfInterface_bounds), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_bounds_line_717, __pyx_k_BpfInterface_bounds_line_717, sizeof(__pyx_k_BpfInterface_bounds_line_717), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_ceil, __pyx_k_BpfInterface_ceil, sizeof(__pyx_k_BpfInterface_ceil), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_clip, __pyx_k_BpfInterface_clip, sizeof(__pyx_k_BpfInterface_clip), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_clip_line_1342, __pyx_k_BpfInterface_clip_line_1342, sizeof(__pyx_k_BpfInterface_clip_line_1342), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_concat, __pyx_k_BpfInterface_concat, sizeof(__pyx_k_BpfInterface_concat), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_concat_line_1147, __pyx_k_BpfInterface_concat_line_1147, sizeof(__pyx_k_BpfInterface_concat_line_1147), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_copy, __pyx_k_BpfInterface_copy, sizeof(__pyx_k_BpfInterface_copy), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_cos, __pyx_k_BpfInterface_cos, sizeof(__pyx_k_BpfInterface_cos), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_db2amp, __pyx_k_BpfInterface_db2amp, sizeof(__pyx_k_BpfInterface_db2amp), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_db2amp_line_1307, __pyx_k_BpfInterface_db2amp_line_1307, sizeof(__pyx_k_BpfInterface_db2amp_line_1307), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_debug, __pyx_k_BpfInterface_debug, sizeof(__pyx_k_BpfInterface_debug), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_derivative, __pyx_k_BpfInterface_derivative, sizeof(__pyx_k_BpfInterface_derivative), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_derivative_line_136, __pyx_k_BpfInterface_derivative_line_136, sizeof(__pyx_k_BpfInterface_derivative_line_136), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_dxton, __pyx_k_BpfInterface_dxton, sizeof(__pyx_k_BpfInterface_dxton), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_expon, __pyx_k_BpfInterface_expon, sizeof(__pyx_k_BpfInterface_expon), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_expon_line_1202, __pyx_k_BpfInterface_expon_line_1202, sizeof(__pyx_k_BpfInterface_expon_line_1202), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_f2m, __pyx_k_BpfInterface_f2m, sizeof(__pyx_k_BpfInterface_f2m), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_f2m_line_1289, __pyx_k_BpfInterface_f2m_line_1289, sizeof(__pyx_k_BpfInterface_f2m_line_1289), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_fit_between, __pyx_k_BpfInterface_fit_between, sizeof(__pyx_k_BpfInterface_fit_between), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_fit_between_line_18, __pyx_k_BpfInterface_fit_between_line_18, sizeof(__pyx_k_BpfInterface_fit_between_line_18), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_floor, __pyx_k_BpfInterface_floor, sizeof(__pyx_k_BpfInterface_floor), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_fromseq, __pyx_k_BpfInterface_fromseq, sizeof(__pyx_k_BpfInterface_fromseq), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_integrate, __pyx_k_BpfInterface_integrate, sizeof(__pyx_k_BpfInterface_integrate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_integrate_between, __pyx_k_BpfInterface_integrate_between, sizeof(__pyx_k_BpfInterface_integrate_between), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_integrate_line_1428, __pyx_k_BpfInterface_integrate_line_1428, sizeof(__pyx_k_BpfInterface_integrate_line_1428), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_integrated, __pyx_k_BpfInterface_integrated, sizeof(__pyx_k_BpfInterface_integrated), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_inverted, __pyx_k_BpfInterface_inverted, sizeof(__pyx_k_BpfInterface_inverted), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_keep_slope, __pyx_k_BpfInterface_keep_slope, sizeof(__pyx_k_BpfInterface_keep_slope), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_log, __pyx_k_BpfInterface_log, sizeof(__pyx_k_BpfInterface_log), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_log10, __pyx_k_BpfInterface_log10, sizeof(__pyx_k_BpfInterface_log10), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_m2f, __pyx_k_BpfInterface_m2f, sizeof(__pyx_k_BpfInterface_m2f), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_m2f_line_1269, __pyx_k_BpfInterface_m2f_line_1269, sizeof(__pyx_k_BpfInterface_m2f_line_1269), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_map, __pyx_k_BpfInterface_map, sizeof(__pyx_k_BpfInterface_map), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_map_line_1106, __pyx_k_BpfInterface_map_line_1106, sizeof(__pyx_k_BpfInterface_map_line_1106), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_mapn_between, __pyx_k_BpfInterface_mapn_between, sizeof(__pyx_k_BpfInterface_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_max, __pyx_k_BpfInterface_max, sizeof(__pyx_k_BpfInterface_max), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_max_line_1560, __pyx_k_BpfInterface_max_line_1560, sizeof(__pyx_k_BpfInterface_max_line_1560), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_mean, __pyx_k_BpfInterface_mean, sizeof(__pyx_k_BpfInterface_mean), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_min, __pyx_k_BpfInterface_min, sizeof(__pyx_k_BpfInterface_min), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_min_line_1588, __pyx_k_BpfInterface_min_line_1588, sizeof(__pyx_k_BpfInterface_min_line_1588), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_ntodx, __pyx_k_BpfInterface_ntodx, sizeof(__pyx_k_BpfInterface_ntodx), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_outbound, __pyx_k_BpfInterface_outbound, sizeof(__pyx_k_BpfInterface_outbound), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_outbound_line_1664, __pyx_k_BpfInterface_outbound_line_1664, sizeof(__pyx_k_BpfInterface_outbound_line_1664), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_periodic, __pyx_k_BpfInterface_periodic, sizeof(__pyx_k_BpfInterface_periodic), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_periodic_line_1753, __pyx_k_BpfInterface_periodic_line_1753, sizeof(__pyx_k_BpfInterface_periodic_line_1753), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_plot, __pyx_k_BpfInterface_plot, sizeof(__pyx_k_BpfInterface_plot), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_preapply, __pyx_k_BpfInterface_preapply, sizeof(__pyx_k_BpfInterface_preapply), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_preapply_line_1723, __pyx_k_BpfInterface_preapply_line_1723, sizeof(__pyx_k_BpfInterface_preapply_line_1723), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_rand, __pyx_k_BpfInterface_rand, sizeof(__pyx_k_BpfInterface_rand), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_render, __pyx_k_BpfInterface_render, sizeof(__pyx_k_BpfInterface_render), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_render_line_892, __pyx_k_BpfInterface_render_line_892, sizeof(__pyx_k_BpfInterface_render_line_892), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_round, __pyx_k_BpfInterface_round, sizeof(__pyx_k_BpfInterface_round), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_sample_between, __pyx_k_BpfInterface_sample_between, sizeof(__pyx_k_BpfInterface_sample_between), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_sample_between_line, __pyx_k_BpfInterface_sample_between_line, sizeof(__pyx_k_BpfInterface_sample_between_line), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_sampled, __pyx_k_BpfInterface_sampled, sizeof(__pyx_k_BpfInterface_sampled), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_sampled_between, __pyx_k_BpfInterface_sampled_between, sizeof(__pyx_k_BpfInterface_sampled_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_shifted, __pyx_k_BpfInterface_shifted, sizeof(__pyx_k_BpfInterface_shifted), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_shifted_line_1861, __pyx_k_BpfInterface_shifted_line_1861, sizeof(__pyx_k_BpfInterface_shifted_line_1861), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_sin, __pyx_k_BpfInterface_sin, sizeof(__pyx_k_BpfInterface_sin), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_sinh, __pyx_k_BpfInterface_sinh, sizeof(__pyx_k_BpfInterface_sinh), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_sqrt, __pyx_k_BpfInterface_sqrt, sizeof(__pyx_k_BpfInterface_sqrt), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_stretched, __pyx_k_BpfInterface_stretched, sizeof(__pyx_k_BpfInterface_stretched), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_stretched_line_1777, __pyx_k_BpfInterface_stretched_line_1777, sizeof(__pyx_k_BpfInterface_stretched_line_1777), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInterface_tan, __pyx_k_BpfInterface_tan, sizeof(__pyx_k_BpfInterface_tan), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_tanh, __pyx_k_BpfInterface_tanh, sizeof(__pyx_k_BpfInterface_tanh), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_trapz_integrate_bet, __pyx_k_BpfInterface_trapz_integrate_bet, sizeof(__pyx_k_BpfInterface_trapz_integrate_bet), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInterface_zeros, __pyx_k_BpfInterface_zeros, sizeof(__pyx_k_BpfInterface_zeros), 0, 0, 1, 1},
  {&__pyx_kp_u_BpfInterface_zeros_line_1529, __pyx_k_BpfInterface_zeros_line_1529, sizeof(__pyx_k_BpfInterface_zeros_line_1529), 0, 1, 0, 0},
  {&__pyx_n_s_BpfInversionError, __pyx_k_BpfInversionError, sizeof(__pyx_k_BpfInversionError), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInverted, __pyx_k_BpfInverted, sizeof(__pyx_k_BpfInverted), 0, 0, 1, 1},
  {&__pyx_n_s_BpfInverted___getstate, __pyx_k_BpfInverted___getstate, sizeof(__pyx_k_BpfInverted___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfKeepSlope, __pyx_k_BpfKeepSlope, sizeof(__pyx_k_BpfKeepSlope), 0, 0, 1, 1},
  {&__pyx_n_s_BpfKeepSlope___getstate, __pyx_k_BpfKeepSlope___getstate, sizeof(__pyx_k_BpfKeepSlope___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaAdd, __pyx_k_BpfLambdaAdd, sizeof(__pyx_k_BpfLambdaAdd), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaAddConst, __pyx_k_BpfLambdaAddConst, sizeof(__pyx_k_BpfLambdaAddConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaAddConst_integrate_bet, __pyx_k_BpfLambdaAddConst_integrate_bet, sizeof(__pyx_k_BpfLambdaAddConst_integrate_bet), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaAdd_integrate_between, __pyx_k_BpfLambdaAdd_integrate_between, sizeof(__pyx_k_BpfLambdaAdd_integrate_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaClip, __pyx_k_BpfLambdaClip, sizeof(__pyx_k_BpfLambdaClip), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaClip___reduce, __pyx_k_BpfLambdaClip___reduce, sizeof(__pyx_k_BpfLambdaClip___reduce), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaClip___setstate, __pyx_k_BpfLambdaClip___setstate, sizeof(__pyx_k_BpfLambdaClip___setstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaClip_mapn_between, __pyx_k_BpfLambdaClip_mapn_between, sizeof(__pyx_k_BpfLambdaClip_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaDiv, __pyx_k_BpfLambdaDiv, sizeof(__pyx_k_BpfLambdaDiv), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaDivConst, __pyx_k_BpfLambdaDivConst, sizeof(__pyx_k_BpfLambdaDivConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaEqual, __pyx_k_BpfLambdaEqual, sizeof(__pyx_k_BpfLambdaEqual), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaEqualConst, __pyx_k_BpfLambdaEqualConst, sizeof(__pyx_k_BpfLambdaEqualConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaGreaterOrEqualThan, __pyx_k_BpfLambdaGreaterOrEqualThan, sizeof(__pyx_k_BpfLambdaGreaterOrEqualThan), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaGreaterOrEqualThanCons, __pyx_k_BpfLambdaGreaterOrEqualThanCons, sizeof(__pyx_k_BpfLambdaGreaterOrEqualThanCons), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaGreaterThan, __pyx_k_BpfLambdaGreaterThan, sizeof(__pyx_k_BpfLambdaGreaterThan), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaGreaterThanConst, __pyx_k_BpfLambdaGreaterThanConst, sizeof(__pyx_k_BpfLambdaGreaterThanConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaLog, __pyx_k_BpfLambdaLog, sizeof(__pyx_k_BpfLambdaLog), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaLowerOrEqualThan, __pyx_k_BpfLambdaLowerOrEqualThan, sizeof(__pyx_k_BpfLambdaLowerOrEqualThan), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaLowerOrEqualThanConst, __pyx_k_BpfLambdaLowerOrEqualThanConst, sizeof(__pyx_k_BpfLambdaLowerOrEqualThanConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaLowerThan, __pyx_k_BpfLambdaLowerThan, sizeof(__pyx_k_BpfLambdaLowerThan), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaLowerThanConst, __pyx_k_BpfLambdaLowerThanConst, sizeof(__pyx_k_BpfLambdaLowerThanConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaMod, __pyx_k_BpfLambdaMod, sizeof(__pyx_k_BpfLambdaMod), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaModConst, __pyx_k_BpfLambdaModConst, sizeof(__pyx_k_BpfLambdaModConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaMul, __pyx_k_BpfLambdaMul, sizeof(__pyx_k_BpfLambdaMul), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaMulConst, __pyx_k_BpfLambdaMulConst, sizeof(__pyx_k_BpfLambdaMulConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaMulConst_integrate_bet, __pyx_k_BpfLambdaMulConst_integrate_bet, sizeof(__pyx_k_BpfLambdaMulConst_integrate_bet), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaPow, __pyx_k_BpfLambdaPow, sizeof(__pyx_k_BpfLambdaPow), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaPowConst, __pyx_k_BpfLambdaPowConst, sizeof(__pyx_k_BpfLambdaPowConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaRDiv, __pyx_k_BpfLambdaRDiv, sizeof(__pyx_k_BpfLambdaRDiv), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaRDivConst, __pyx_k_BpfLambdaRDivConst, sizeof(__pyx_k_BpfLambdaRDivConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaRPowConst, __pyx_k_BpfLambdaRPowConst, sizeof(__pyx_k_BpfLambdaRPowConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaRSub, __pyx_k_BpfLambdaRSub, sizeof(__pyx_k_BpfLambdaRSub), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaRSubConst, __pyx_k_BpfLambdaRSubConst, sizeof(__pyx_k_BpfLambdaRSubConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaRSubConst_integrate_be, __pyx_k_BpfLambdaRSubConst_integrate_be, sizeof(__pyx_k_BpfLambdaRSubConst_integrate_be), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaRSub_integrate_between, __pyx_k_BpfLambdaRSub_integrate_between, sizeof(__pyx_k_BpfLambdaRSub_integrate_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaRound, __pyx_k_BpfLambdaRound, sizeof(__pyx_k_BpfLambdaRound), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaSub, __pyx_k_BpfLambdaSub, sizeof(__pyx_k_BpfLambdaSub), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaSubConst, __pyx_k_BpfLambdaSubConst, sizeof(__pyx_k_BpfLambdaSubConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaSubConst_integrate_bet, __pyx_k_BpfLambdaSubConst_integrate_bet, sizeof(__pyx_k_BpfLambdaSubConst_integrate_bet), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaSub_integrate_between, __pyx_k_BpfLambdaSub_integrate_between, sizeof(__pyx_k_BpfLambdaSub_integrate_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaUnequal, __pyx_k_BpfLambdaUnequal, sizeof(__pyx_k_BpfLambdaUnequal), 0, 0, 1, 1},
  {&__pyx_n_s_BpfLambdaUnequalConst, __pyx_k_BpfLambdaUnequalConst, sizeof(__pyx_k_BpfLambdaUnequalConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfM2F, __pyx_k_BpfM2F, sizeof(__pyx_k_BpfM2F), 0, 0, 1, 1},
  {&__pyx_n_s_BpfMaxConst, __pyx_k_BpfMaxConst, sizeof(__pyx_k_BpfMaxConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfMinConst, __pyx_k_BpfMinConst, sizeof(__pyx_k_BpfMinConst), 0, 0, 1, 1},
  {&__pyx_n_s_BpfPeriodic, __pyx_k_BpfPeriodic, sizeof(__pyx_k_BpfPeriodic), 0, 0, 1, 1},
  {&__pyx_n_s_BpfPeriodic___getstate, __pyx_k_BpfPeriodic___getstate, sizeof(__pyx_k_BpfPeriodic___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfPointsError, __pyx_k_BpfPointsError, sizeof(__pyx_k_BpfPointsError), 0, 0, 1, 1},
  {&__pyx_n_s_BpfProjection, __pyx_k_BpfProjection, sizeof(__pyx_k_BpfProjection), 0, 0, 1, 1},
  {&__pyx_n_s_BpfProjection___getstate, __pyx_k_BpfProjection___getstate, sizeof(__pyx_k_BpfProjection___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfProjection_fixpoint, __pyx_k_BpfProjection_fixpoint, sizeof(__pyx_k_BpfProjection_fixpoint), 0, 0, 1, 1},
  {&__pyx_n_s_BpfRand, __pyx_k_BpfRand, sizeof(__pyx_k_BpfRand), 0, 0, 1, 1},
  {&__pyx_n_s_BpfSelect, __pyx_k_BpfSelect, sizeof(__pyx_k_BpfSelect), 0, 0, 1, 1},
  {&__pyx_n_s_BpfUnaryFunc, __pyx_k_BpfUnaryFunc, sizeof(__pyx_k_BpfUnaryFunc), 0, 0, 1, 1},
  {&__pyx_n_s_BpfUnaryFunc___reduce, __pyx_k_BpfUnaryFunc___reduce, sizeof(__pyx_k_BpfUnaryFunc___reduce), 0, 0, 1, 1},
  {&__pyx_n_s_BpfUnaryFunc___setstate, __pyx_k_BpfUnaryFunc___setstate, sizeof(__pyx_k_BpfUnaryFunc___setstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfUnaryFunc_map, __pyx_k_BpfUnaryFunc_map, sizeof(__pyx_k_BpfUnaryFunc_map), 0, 0, 1, 1},
  {&__pyx_n_s_BpfUnaryFunc_mapn_between, __pyx_k_BpfUnaryFunc_mapn_between, sizeof(__pyx_k_BpfUnaryFunc_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_BpfUnaryOp, __pyx_k_BpfUnaryOp, sizeof(__pyx_k_BpfUnaryOp), 0, 0, 1, 1},
  {&__pyx_n_s_BpfUnaryOp___getstate, __pyx_k_BpfUnaryOp___getstate, sizeof(__pyx_k_BpfUnaryOp___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_BpfUnaryOp__get_xs_for_renderin, __pyx_k_BpfUnaryOp__get_xs_for_renderin, sizeof(__pyx_k_BpfUnaryOp__get_xs_for_renderin), 0, 0, 1, 1},
  {&__pyx_n_s_BpfUnaryOp_map, __pyx_k_BpfUnaryOp_map, sizeof(__pyx_k_BpfUnaryOp_map), 0, 0, 1, 1},
  {&__pyx_n_s_BpfUnaryOp_mapn_between, __pyx_k_BpfUnaryOp_mapn_between, sizeof(__pyx_k_BpfUnaryOp_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_Bpf_amp2db, __pyx_k_Bpf_amp2db, sizeof(__pyx_k_Bpf_amp2db), 0, 0, 1, 1},
  {&__pyx_n_s_Bpf_db2amp, __pyx_k_Bpf_db2amp, sizeof(__pyx_k_Bpf_db2amp), 0, 0, 1, 1},
  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
  {&__pyx_n_s_CONFIG, __pyx_k_CONFIG, sizeof(__pyx_k_CONFIG), 0, 0, 1, 1},
  {&__pyx_n_s_CONST_XS_FOR_RENDERING, __pyx_k_CONST_XS_FOR_RENDERING, sizeof(__pyx_k_CONST_XS_FOR_RENDERING), 0, 0, 1, 1},
  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
  {&__pyx_kp_u_Can_t_creat_a_BPF_of_0_points, __pyx_k_Can_t_creat_a_BPF_of_0_points, sizeof(__pyx_k_Can_t_creat_a_BPF_of_0_points), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_t_divide_by_0, __pyx_k_Can_t_divide_by_0, sizeof(__pyx_k_Can_t_divide_by_0), 0, 1, 0, 0},
  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
  {&__pyx_kp_u_Cannot_integrate_a_function_with, __pyx_k_Cannot_integrate_a_function_with, sizeof(__pyx_k_Cannot_integrate_a_function_with), 0, 1, 0, 0},
  {&__pyx_kp_u_Concatenate_this_bpf_to_other_o, __pyx_k_Concatenate_this_bpf_to_other_o, sizeof(__pyx_k_Concatenate_this_bpf_to_other_o), 0, 1, 0, 0},
  {&__pyx_n_s_Const, __pyx_k_Const, sizeof(__pyx_k_Const), 0, 0, 1, 1},
  {&__pyx_n_s_Const___getstate, __pyx_k_Const___getstate, sizeof(__pyx_k_Const___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_Const__get_points_for_rendering, __pyx_k_Const__get_points_for_rendering, sizeof(__pyx_k_Const__get_points_for_rendering), 0, 0, 1, 1},
  {&__pyx_n_s_Const_mapn_between, __pyx_k_Const_mapn_between, sizeof(__pyx_k_Const_mapn_between), 0, 0, 1, 1},
  {&__pyx_kp_u_Create_a_bpf_where_func_is_appl, __pyx_k_Create_a_bpf_where_func_is_appl, sizeof(__pyx_k_Create_a_bpf_where_func_is_appl), 0, 1, 0, 0},
  {&__pyx_kp_u_Create_a_bpf_where_func_is_appl_2, __pyx_k_Create_a_bpf_where_func_is_appl_2, sizeof(__pyx_k_Create_a_bpf_where_func_is_appl_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Create_a_curve_which_represents, __pyx_k_Create_a_curve_which_represents, sizeof(__pyx_k_Create_a_curve_which_represents), 0, 1, 0, 0},
  {&__pyx_kp_u_Create_a_new_bpf_representing_t, __pyx_k_Create_a_new_bpf_representing_t, sizeof(__pyx_k_Create_a_new_bpf_representing_t), 0, 1, 0, 0},
  {&__pyx_kp_u_Create_a_new_bpf_which_replicat, __pyx_k_Create_a_new_bpf_which_replicat, sizeof(__pyx_k_Create_a_new_bpf_which_replicat), 0, 1, 0, 0},
  {&__pyx_n_s_DTYPE, __pyx_k_DTYPE, sizeof(__pyx_k_DTYPE), 0, 0, 1, 1},
  {&__pyx_n_s_EPSILON, __pyx_k_EPSILON, sizeof(__pyx_k_EPSILON), 0, 0, 1, 1},
  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
  {&__pyx_n_s_Expon, __pyx_k_Expon, sizeof(__pyx_k_Expon), 0, 0, 1, 1},
  {&__pyx_n_s_Expon___getstate, __pyx_k_Expon___getstate, sizeof(__pyx_k_Expon___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_Expon___setstate, __pyx_k_Expon___setstate, sizeof(__pyx_k_Expon___setstate), 0, 0, 1, 1},
  {&__pyx_n_s_Exponm, __pyx_k_Exponm, sizeof(__pyx_k_Exponm), 0, 0, 1, 1},
  {&__pyx_kp_u_Find_the_zeros_of_this_bpf_Args, __pyx_k_Find_the_zeros_of_this_bpf_Args, sizeof(__pyx_k_Find_the_zeros_of_this_bpf_Args), 0, 1, 0, 0},
  {&__pyx_n_s_FunctionWrap, __pyx_k_FunctionWrap, sizeof(__pyx_k_FunctionWrap), 0, 0, 1, 1},
  {&__pyx_n_s_FunctionWrap_Object, __pyx_k_FunctionWrap_Object, sizeof(__pyx_k_FunctionWrap_Object), 0, 0, 1, 1},
  {&__pyx_n_s_FunctionWrap_Object_OutboundCon, __pyx_k_FunctionWrap_Object_OutboundCon, sizeof(__pyx_k_FunctionWrap_Object_OutboundCon), 0, 0, 1, 1},
  {&__pyx_n_s_FunctionWrap_Object___getstate, __pyx_k_FunctionWrap_Object___getstate, sizeof(__pyx_k_FunctionWrap_Object___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_FunctionWrap_Object__slice, __pyx_k_FunctionWrap_Object__slice, sizeof(__pyx_k_FunctionWrap_Object__slice), 0, 0, 1, 1},
  {&__pyx_n_s_FunctionWrap_Object_map, __pyx_k_FunctionWrap_Object_map, sizeof(__pyx_k_FunctionWrap_Object_map), 0, 0, 1, 1},
  {&__pyx_n_s_FunctionWrap_Object_mapn_betwee, __pyx_k_FunctionWrap_Object_mapn_betwee, sizeof(__pyx_k_FunctionWrap_Object_mapn_betwee), 0, 0, 1, 1},
  {&__pyx_n_s_Halfcos, __pyx_k_Halfcos, sizeof(__pyx_k_Halfcos), 0, 0, 1, 1},
  {&__pyx_n_s_HalfcosExp, __pyx_k_HalfcosExp, sizeof(__pyx_k_HalfcosExp), 0, 0, 1, 1},
  {&__pyx_n_s_Halfcos___getstate, __pyx_k_Halfcos___getstate, sizeof(__pyx_k_Halfcos___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_Halfcosm, __pyx_k_Halfcosm, sizeof(__pyx_k_Halfcosm), 0, 0, 1, 1},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
  {&__pyx_n_s_Linear, __pyx_k_Linear, sizeof(__pyx_k_Linear), 0, 0, 1, 1},
  {&__pyx_n_s_Linear__get_points_for_rendering, __pyx_k_Linear__get_points_for_rendering, sizeof(__pyx_k_Linear__get_points_for_rendering), 0, 0, 1, 1},
  {&__pyx_n_s_Linear_flatpairs, __pyx_k_Linear_flatpairs, sizeof(__pyx_k_Linear_flatpairs), 0, 0, 1, 1},
  {&__pyx_kp_u_Linear_flatpairs_line_2455, __pyx_k_Linear_flatpairs_line_2455, sizeof(__pyx_k_Linear_flatpairs_line_2455), 0, 1, 0, 0},
  {&__pyx_n_s_Linear_integrate_between, __pyx_k_Linear_integrate_between, sizeof(__pyx_k_Linear_integrate_between), 0, 0, 1, 1},
  {&__pyx_n_s_Linear_inverted, __pyx_k_Linear_inverted, sizeof(__pyx_k_Linear_inverted), 0, 0, 1, 1},
  {&__pyx_n_s_Linear_sliced, __pyx_k_Linear_sliced, sizeof(__pyx_k_Linear_sliced), 0, 0, 1, 1},
  {&__pyx_n_s_Max, __pyx_k_Max, sizeof(__pyx_k_Max), 0, 0, 1, 1},
  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
  {&__pyx_n_s_Min, __pyx_k_Min, sizeof(__pyx_k_Min), 0, 0, 1, 1},
  {&__pyx_n_s_Multi, __pyx_k_Multi, sizeof(__pyx_k_Multi), 0, 0, 1, 1},
  {&__pyx_n_s_Multi___getstate, __pyx_k_Multi___getstate, sizeof(__pyx_k_Multi___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_Multi_segments, __pyx_k_Multi_segments, sizeof(__pyx_k_Multi_segments), 0, 0, 1, 1},
  {&__pyx_n_s_MultipleBpfs, __pyx_k_MultipleBpfs, sizeof(__pyx_k_MultipleBpfs), 0, 0, 1, 1},
  {&__pyx_n_s_MultipleBpfs___getstate, __pyx_k_MultipleBpfs___getstate, sizeof(__pyx_k_MultipleBpfs___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_MultipleBpfs__calculate_bounds, __pyx_k_MultipleBpfs__calculate_bounds, sizeof(__pyx_k_MultipleBpfs__calculate_bounds), 0, 0, 1, 1},
  {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
  {&__pyx_n_s_Nearest, __pyx_k_Nearest, sizeof(__pyx_k_Nearest), 0, 0, 1, 1},
  {&__pyx_n_s_Nearest___getstate, __pyx_k_Nearest___getstate, sizeof(__pyx_k_Nearest___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_Nexp, __pyx_k_Nexp, sizeof(__pyx_k_Nexp), 0, 0, 1, 1},
  {&__pyx_n_s_NoInterpol, __pyx_k_NoInterpol, sizeof(__pyx_k_NoInterpol), 0, 0, 1, 1},
  {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {&__pyx_kp_u_Points_along_the_x_coord_should, __pyx_k_Points_along_the_x_coord_should, sizeof(__pyx_k_Points_along_the_x_coord_should), 0, 1, 0, 0},
  {&__pyx_kp_u_Points_along_the_x_coord_should_2, __pyx_k_Points_along_the_x_coord_should_2, sizeof(__pyx_k_Points_along_the_x_coord_should_2), 0, 1, 0, 0},
  {&__pyx_n_s_Pyx_CFunc_double____double, __pyx_k_Pyx_CFunc_double____double, sizeof(__pyx_k_Pyx_CFunc_double____double), 0, 0, 1, 1},
  {&__pyx_kp_u_Return_a_bpf_clipping_the_resul, __pyx_k_Return_a_bpf_clipping_the_resul, sizeof(__pyx_k_Return_a_bpf_clipping_the_resul), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_a_curve_which_represents, __pyx_k_Return_a_curve_which_represents, sizeof(__pyx_k_Return_a_curve_which_represents), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_a_new_Bpf_with_the_given, __pyx_k_Return_a_new_Bpf_with_the_given, sizeof(__pyx_k_Return_a_new_Bpf_with_the_given), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_the_result_of_the_integr, __pyx_k_Return_the_result_of_the_integr, sizeof(__pyx_k_Return_the_result_of_the_integr), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_bpf_converting_decibe, __pyx_k_Returns_a_bpf_converting_decibe, sizeof(__pyx_k_Returns_a_bpf_converting_decibe), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_bpf_converting_frequen, __pyx_k_Returns_a_bpf_converting_frequen, sizeof(__pyx_k_Returns_a_bpf_converting_frequen), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_bpf_converting_from_mi, __pyx_k_Returns_a_bpf_converting_from_mi, sizeof(__pyx_k_Returns_a_bpf_converting_from_mi), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_bpf_converting_linear, __pyx_k_Returns_a_bpf_converting_linear, sizeof(__pyx_k_Returns_a_bpf_converting_linear), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_bpf_representing_max, __pyx_k_Returns_a_bpf_representing_max, sizeof(__pyx_k_Returns_a_bpf_representing_max), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_bpf_representing_min, __pyx_k_Returns_a_bpf_representing_min, sizeof(__pyx_k_Returns_a_bpf_representing_min), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_bpf_representing_the_e, __pyx_k_Returns_a_bpf_representing_the_e, sizeof(__pyx_k_Returns_a_bpf_representing_the_e), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_flat_1D_array_with_x, __pyx_k_Returns_a_flat_1D_array_with_x, sizeof(__pyx_k_Returns_a_flat_1D_array_with_x), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_flat_1D_array_with_x_2, __pyx_k_Returns_a_flat_1D_array_with_x_2, sizeof(__pyx_k_Returns_a_flat_1D_array_with_x_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_tuple_with_the_points, __pyx_k_Returns_a_tuple_with_the_points, sizeof(__pyx_k_Returns_a_tuple_with_the_points), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_tuple_with_the_points_2, __pyx_k_Returns_a_tuple_with_the_points_2, sizeof(__pyx_k_Returns_a_tuple_with_the_points_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_tuple_xstart_xend_rep, __pyx_k_Returns_a_tuple_xstart_xend_rep, sizeof(__pyx_k_Returns_a_tuple_xstart_xend_rep), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_view_of_this_bpf_fitt, __pyx_k_Returns_a_view_of_this_bpf_fitt, sizeof(__pyx_k_Returns_a_view_of_this_bpf_fitt), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_view_of_this_bpf_shif, __pyx_k_Returns_a_view_of_this_bpf_shif, sizeof(__pyx_k_Returns_a_view_of_this_bpf_shif), 0, 1, 0, 0},
  {&__pyx_kp_u_Returns_a_view_of_this_bpf_stre, __pyx_k_Returns_a_view_of_this_bpf_stre, sizeof(__pyx_k_Returns_a_view_of_this_bpf_stre), 0, 1, 0, 0},
  {&__pyx_kp_u_Sample_this_bpf_at_an_interval, __pyx_k_Sample_this_bpf_at_an_interval, sizeof(__pyx_k_Sample_this_bpf_at_an_interval), 0, 1, 0, 0},
  {&__pyx_n_s_Sampled, __pyx_k_Sampled, sizeof(__pyx_k_Sampled), 0, 0, 1, 1},
  {&__pyx_n_s_Sampled___getstate, __pyx_k_Sampled___getstate, sizeof(__pyx_k_Sampled___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_Sampled__get_points_for_renderin, __pyx_k_Sampled__get_points_for_renderin, sizeof(__pyx_k_Sampled__get_points_for_renderin), 0, 0, 1, 1},
  {&__pyx_n_s_Sampled_derivative, __pyx_k_Sampled_derivative, sizeof(__pyx_k_Sampled_derivative), 0, 0, 1, 1},
  {&__pyx_kp_u_Sampled_derivative_line_3124, __pyx_k_Sampled_derivative_line_3124, sizeof(__pyx_k_Sampled_derivative_line_3124), 0, 1, 0, 0},
  {&__pyx_n_s_Sampled_flatpairs, __pyx_k_Sampled_flatpairs, sizeof(__pyx_k_Sampled_flatpairs), 0, 0, 1, 1},
  {&__pyx_kp_u_Sampled_flatpairs_line_3175, __pyx_k_Sampled_flatpairs_line_3175, sizeof(__pyx_k_Sampled_flatpairs_line_3175), 0, 1, 0, 0},
  {&__pyx_n_s_Sampled_fromseq, __pyx_k_Sampled_fromseq, sizeof(__pyx_k_Sampled_fromseq), 0, 0, 1, 1},
  {&__pyx_n_s_Sampled_integrate, __pyx_k_Sampled_integrate, sizeof(__pyx_k_Sampled_integrate), 0, 0, 1, 1},
  {&__pyx_n_s_Sampled_integrate_between, __pyx_k_Sampled_integrate_between, sizeof(__pyx_k_Sampled_integrate_between), 0, 0, 1, 1},
  {&__pyx_n_s_Sampled_inverted, __pyx_k_Sampled_inverted, sizeof(__pyx_k_Sampled_inverted), 0, 0, 1, 1},
  {&__pyx_n_s_Sampled_mapn_between, __pyx_k_Sampled_mapn_between, sizeof(__pyx_k_Sampled_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_Sampled_points, __pyx_k_Sampled_points, sizeof(__pyx_k_Sampled_points), 0, 0, 1, 1},
  {&__pyx_kp_u_Sampled_points_line_2907, __pyx_k_Sampled_points_line_2907, sizeof(__pyx_k_Sampled_points_line_2907), 0, 1, 0, 0},
  {&__pyx_n_s_Sampled_segments, __pyx_k_Sampled_segments, sizeof(__pyx_k_Sampled_segments), 0, 0, 1, 1},
  {&__pyx_n_s_Sampled_set_interpolation, __pyx_k_Sampled_set_interpolation, sizeof(__pyx_k_Sampled_set_interpolation), 0, 0, 1, 1},
  {&__pyx_n_s_Slope, __pyx_k_Slope, sizeof(__pyx_k_Slope), 0, 0, 1, 1},
  {&__pyx_n_s_Slope___getstate, __pyx_k_Slope___getstate, sizeof(__pyx_k_Slope___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_Slope__slice, __pyx_k_Slope__slice, sizeof(__pyx_k_Slope__slice), 0, 0, 1, 1},
  {&__pyx_n_s_Slope_mapn_between, __pyx_k_Slope_mapn_between, sizeof(__pyx_k_Slope_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_Smooth, __pyx_k_Smooth, sizeof(__pyx_k_Smooth), 0, 0, 1, 1},
  {&__pyx_n_s_Smoother, __pyx_k_Smoother, sizeof(__pyx_k_Smoother), 0, 0, 1, 1},
  {&__pyx_n_s_Spline, __pyx_k_Spline, sizeof(__pyx_k_Spline), 0, 0, 1, 1},
  {&__pyx_n_s_Spline___getstate, __pyx_k_Spline___getstate, sizeof(__pyx_k_Spline___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_Spline_points, __pyx_k_Spline_points, sizeof(__pyx_k_Spline_points), 0, 0, 1, 1},
  {&__pyx_kp_u_Spline_points_line_3248, __pyx_k_Spline_points_line_3248, sizeof(__pyx_k_Spline_points_line_3248), 0, 1, 0, 0},
  {&__pyx_n_s_Spline_segments, __pyx_k_Spline_segments, sizeof(__pyx_k_Spline_segments), 0, 0, 1, 1},
  {&__pyx_kp_u_The_instantiation_form_x0_y0_x1, __pyx_k_The_instantiation_form_x0_y0_x1, sizeof(__pyx_k_The_instantiation_form_x0_y0_x1), 0, 1, 0, 0},
  {&__pyx_kp_u_The_same_as_map_self_xs_but_fas, __pyx_k_The_same_as_map_self_xs_but_fas, sizeof(__pyx_k_The_same_as_map_self_xs_but_fas), 0, 1, 0, 0},
  {&__pyx_kp_u_This_bpf_is_unbounded_cannot_be, __pyx_k_This_bpf_is_unbounded_cannot_be, sizeof(__pyx_k_This_bpf_is_unbounded_cannot_be), 0, 1, 0, 0},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_USpline, __pyx_k_USpline, sizeof(__pyx_k_USpline), 0, 0, 1, 1},
  {&__pyx_n_s_USpline_map, __pyx_k_USpline_map, sizeof(__pyx_k_USpline_map), 0, 0, 1, 1},
  {&__pyx_n_s_USpline_mapn_between, __pyx_k_USpline_mapn_between, sizeof(__pyx_k_USpline_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_USpline_segments, __pyx_k_USpline_segments, sizeof(__pyx_k_USpline_segments), 0, 0, 1, 1},
  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
  {&__pyx_n_s_UnivariateSpline, __pyx_k_UnivariateSpline, sizeof(__pyx_k_UnivariateSpline), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
  {&__pyx_n_s_ZeroDivisionError, __pyx_k_ZeroDivisionError, sizeof(__pyx_k_ZeroDivisionError), 0, 0, 1, 1},
  {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
  {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0},
  {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0},
  {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0},
  {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1},
  {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
  {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1},
  {&__pyx_n_s_acos, __pyx_k_acos, sizeof(__pyx_k_acos), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_amp2db, __pyx_k_amp2db, sizeof(__pyx_k_amp2db), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_apply, __pyx_k_apply, sizeof(__pyx_k_apply), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_n_s_array_issorted, __pyx_k_array_issorted, sizeof(__pyx_k_array_issorted), 0, 0, 1, 1},
  {&__pyx_n_s_arrayslice, __pyx_k_arrayslice, sizeof(__pyx_k_arrayslice), 0, 0, 1, 1},
  {&__pyx_n_s_arraytools, __pyx_k_arraytools, sizeof(__pyx_k_arraytools), 0, 0, 1, 1},
  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
  {&__pyx_n_s_asbpf, __pyx_k_asbpf, sizeof(__pyx_k_asbpf), 0, 0, 1, 1},
  {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1},
  {&__pyx_n_s_asin, __pyx_k_asin, sizeof(__pyx_k_asin), 0, 0, 1, 1},
  {&__pyx_n_s_axes, __pyx_k_axes, sizeof(__pyx_k_axes), 0, 0, 1, 1},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_s_b_end, __pyx_k_b_end, sizeof(__pyx_k_b_end), 0, 0, 1, 1},
  {&__pyx_n_s_b_start, __pyx_k_b_start, sizeof(__pyx_k_b_start), 0, 0, 1, 1},
  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_s_blend, __pyx_k_blend, sizeof(__pyx_k_blend), 0, 0, 1, 1},
  {&__pyx_n_s_bound0, __pyx_k_bound0, sizeof(__pyx_k_bound0), 0, 0, 1, 1},
  {&__pyx_n_s_bound1, __pyx_k_bound1, sizeof(__pyx_k_bound1), 0, 0, 1, 1},
  {&__pyx_n_s_bounds, __pyx_k_bounds, sizeof(__pyx_k_bounds), 0, 0, 1, 1},
  {&__pyx_n_s_bounds0, __pyx_k_bounds0, sizeof(__pyx_k_bounds0), 0, 0, 1, 1},
  {&__pyx_n_s_bounds1, __pyx_k_bounds1, sizeof(__pyx_k_bounds1), 0, 0, 1, 1},
  {&__pyx_n_s_bpf, __pyx_k_bpf, sizeof(__pyx_k_bpf), 0, 0, 1, 1},
  {&__pyx_n_s_bpf4_core, __pyx_k_bpf4_core, sizeof(__pyx_k_bpf4_core), 0, 0, 1, 1},
  {&__pyx_kp_s_bpf4_core_pyx, __pyx_k_bpf4_core_pyx, sizeof(__pyx_k_bpf4_core_pyx), 0, 0, 1, 0},
  {&__pyx_kp_u_bpf_can_t_be_inverted_ys_must_al, __pyx_k_bpf_can_t_be_inverted_ys_must_al, sizeof(__pyx_k_bpf_can_t_be_inverted_ys_must_al), 0, 1, 0, 0},
  {&__pyx_n_s_bpf_zero_crossings, __pyx_k_bpf_zero_crossings, sizeof(__pyx_k_bpf_zero_crossings), 0, 0, 1, 1},
  {&__pyx_n_s_bpfs, __pyx_k_bpfs, sizeof(__pyx_k_bpfs), 0, 0, 1, 1},
  {&__pyx_n_s_brentq, __pyx_k_brentq, sizeof(__pyx_k_brentq), 0, 0, 1, 1},
  {&__pyx_kp_u_brentq_line_5140, __pyx_k_brentq_line_5140, sizeof(__pyx_k_brentq_line_5140), 0, 1, 0, 0},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
  {&__pyx_n_s_calculate_bounds, __pyx_k_calculate_bounds, sizeof(__pyx_k_calculate_bounds), 0, 0, 1, 1},
  {&__pyx_kp_u_calculate_the_zero_of_bpf_x0_in, __pyx_k_calculate_the_zero_of_bpf_x0_in, sizeof(__pyx_k_calculate_the_zero_of_bpf_x0_in), 0, 1, 0, 0},
  {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1},
  {&__pyx_n_u_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 1, 0, 1},
  {&__pyx_kp_u_cannot_integrate_a_function_with, __pyx_k_cannot_integrate_a_function_with, sizeof(__pyx_k_cannot_integrate_a_function_with), 0, 1, 0, 0},
  {&__pyx_n_s_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 0, 1, 1},
  {&__pyx_n_s_cfunc_to_py, __pyx_k_cfunc_to_py, sizeof(__pyx_k_cfunc_to_py), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1},
  {&__pyx_n_s_clone_with_new_data, __pyx_k_clone_with_new_data, sizeof(__pyx_k_clone_with_new_data), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
  {&__pyx_n_s_concat, __pyx_k_concat, sizeof(__pyx_k_concat), 0, 0, 1, 1},
  {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1},
  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_cos, __pyx_k_cos, sizeof(__pyx_k_cos), 0, 0, 1, 1},
  {&__pyx_kp_u_could_not_import_scipy_USpline_i, __pyx_k_could_not_import_scipy_USpline_i, sizeof(__pyx_k_could_not_import_scipy_USpline_i), 0, 1, 0, 0},
  {&__pyx_kp_u_could_not_invert_bpf, __pyx_k_could_not_invert_bpf, sizeof(__pyx_k_could_not_invert_bpf), 0, 1, 0, 0},
  {&__pyx_kp_u_crop_outbound_mode, __pyx_k_crop_outbound_mode, sizeof(__pyx_k_crop_outbound_mode), 0, 1, 0, 0},
  {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_db2amp, __pyx_k_db2amp, sizeof(__pyx_k_db2amp), 0, 0, 1, 1},
  {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1},
  {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1},
  {&__pyx_n_s_derivative, __pyx_k_derivative, sizeof(__pyx_k_derivative), 0, 0, 1, 1},
  {&__pyx_n_s_descr, __pyx_k_descr, sizeof(__pyx_k_descr), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
  {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1},
  {&__pyx_n_s_dxton, __pyx_k_dxton, sizeof(__pyx_k_dxton), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_endpoint, __pyx_k_endpoint, sizeof(__pyx_k_endpoint), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_epsilon, __pyx_k_epsilon, sizeof(__pyx_k_epsilon), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_n_s_exp, __pyx_k_exp, sizeof(__pyx_k_exp), 0, 0, 1, 1},
  {&__pyx_kp_u_exp_2, __pyx_k_exp_2, sizeof(__pyx_k_exp_2), 0, 1, 0, 0},
  {&__pyx_n_s_expon, __pyx_k_expon, sizeof(__pyx_k_expon), 0, 0, 1, 1},
  {&__pyx_n_u_expon, __pyx_k_expon, sizeof(__pyx_k_expon), 0, 1, 0, 1},
  {&__pyx_kp_u_expon_3, __pyx_k_expon_3, sizeof(__pyx_k_expon_3), 0, 1, 0, 0},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_n_s_f2m, __pyx_k_f2m, sizeof(__pyx_k_f2m), 0, 0, 1, 1},
  {&__pyx_kp_u_f_is_not_in_points, __pyx_k_f_is_not_in_points, sizeof(__pyx_k_f_is_not_in_points), 0, 1, 0, 0},
  {&__pyx_kp_u_fade_is_not_implemented, __pyx_k_fade_is_not_implemented, sizeof(__pyx_k_fade_is_not_implemented), 0, 1, 0, 0},
  {&__pyx_n_s_fadeshape, __pyx_k_fadeshape, sizeof(__pyx_k_fadeshape), 0, 0, 1, 1},
  {&__pyx_n_s_fadetime, __pyx_k_fadetime, sizeof(__pyx_k_fadetime), 0, 0, 1, 1},
  {&__pyx_n_s_fit_between, __pyx_k_fit_between, sizeof(__pyx_k_fit_between), 0, 0, 1, 1},
  {&__pyx_n_s_fixpoint, __pyx_k_fixpoint, sizeof(__pyx_k_fixpoint), 0, 0, 1, 1},
  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  {&__pyx_n_s_flatpairs, __pyx_k_flatpairs, sizeof(__pyx_k_flatpairs), 0, 0, 1, 1},
  {&__pyx_n_u_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 1, 0, 1},
  {&__pyx_n_s_float_2, __pyx_k_float_2, sizeof(__pyx_k_float_2), 0, 0, 1, 1},
  {&__pyx_n_s_float_info, __pyx_k_float_info, sizeof(__pyx_k_float_info), 0, 0, 1, 1},
  {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
  {&__pyx_n_s_freq, __pyx_k_freq, sizeof(__pyx_k_freq), 0, 0, 1, 1},
  {&__pyx_n_s_fromseq, __pyx_k_fromseq, sizeof(__pyx_k_fromseq), 0, 0, 1, 1},
  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  {&__pyx_n_s_funcalls, __pyx_k_funcalls, sizeof(__pyx_k_funcalls), 0, 0, 1, 1},
  {&__pyx_n_s_funcindex, __pyx_k_funcindex, sizeof(__pyx_k_funcindex), 0, 0, 1, 1},
  {&__pyx_n_s_fx, __pyx_k_fx, sizeof(__pyx_k_fx), 0, 0, 1, 1},
  {&__pyx_n_s_get_bounds, __pyx_k_get_bounds, sizeof(__pyx_k_get_bounds), 0, 0, 1, 1},
  {&__pyx_n_s_get_points_for_rendering, __pyx_k_get_points_for_rendering, sizeof(__pyx_k_get_points_for_rendering), 0, 0, 1, 1},
  {&__pyx_n_s_get_xs_for_rendering, __pyx_k_get_xs_for_rendering, sizeof(__pyx_k_get_xs_for_rendering), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
  {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
  {&__pyx_n_u_halfcos, __pyx_k_halfcos, sizeof(__pyx_k_halfcos), 0, 1, 0, 1},
  {&__pyx_n_u_halfcosexp, __pyx_k_halfcosexp, sizeof(__pyx_k_halfcosexp), 0, 1, 0, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1},
  {&__pyx_n_s_insertpoint, __pyx_k_insertpoint, sizeof(__pyx_k_insertpoint), 0, 0, 1, 1},
  {&__pyx_n_s_integrate, __pyx_k_integrate, sizeof(__pyx_k_integrate), 0, 0, 1, 1},
  {&__pyx_n_s_integrate_between, __pyx_k_integrate_between, sizeof(__pyx_k_integrate_between), 0, 0, 1, 1},
  {&__pyx_kp_u_integrate_default_mode, __pyx_k_integrate_default_mode, sizeof(__pyx_k_integrate_default_mode), 0, 1, 0, 0},
  {&__pyx_kp_u_integrate_oversample, __pyx_k_integrate_oversample, sizeof(__pyx_k_integrate_oversample), 0, 1, 0, 0},
  {&__pyx_kp_u_integrate_trapz_intervals, __pyx_k_integrate_trapz_intervals, sizeof(__pyx_k_integrate_trapz_intervals), 0, 1, 0, 0},
  {&__pyx_n_s_integrated, __pyx_k_integrated, sizeof(__pyx_k_integrated), 0, 0, 1, 1},
  {&__pyx_n_u_integrationmode, __pyx_k_integrationmode, sizeof(__pyx_k_integrationmode), 0, 1, 0, 1},
  {&__pyx_n_s_interlace_arrays, __pyx_k_interlace_arrays, sizeof(__pyx_k_interlace_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_interpolation, __pyx_k_interpolation, sizeof(__pyx_k_interpolation), 0, 0, 1, 1},
  {&__pyx_kp_u_interpolation_s_not_implemented, __pyx_k_interpolation_s_not_implemented, sizeof(__pyx_k_interpolation_s_not_implemented), 0, 1, 0, 0},
  {&__pyx_kp_u_interpolation_type_not_understoo, __pyx_k_interpolation_type_not_understoo, sizeof(__pyx_k_interpolation_type_not_understoo), 0, 1, 0, 0},
  {&__pyx_n_s_interpolations, __pyx_k_interpolations, sizeof(__pyx_k_interpolations), 0, 0, 1, 1},
  {&__pyx_n_s_interpoltype, __pyx_k_interpoltype, sizeof(__pyx_k_interpoltype), 0, 0, 1, 1},
  {&__pyx_n_s_inverted, __pyx_k_inverted, sizeof(__pyx_k_inverted), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_kp_u_items_2, __pyx_k_items_2, sizeof(__pyx_k_items_2), 0, 1, 0, 0},
  {&__pyx_kp_u_items_and_ys_has, __pyx_k_items_and_ys_has, sizeof(__pyx_k_items_and_ys_has), 0, 1, 0, 0},
  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
  {&__pyx_n_s_keep_slope, __pyx_k_keep_slope, sizeof(__pyx_k_keep_slope), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
  {&__pyx_n_s_kws, __pyx_k_kws, sizeof(__pyx_k_kws), 0, 0, 1, 1},
  {&__pyx_n_s_lenpoints, __pyx_k_lenpoints, sizeof(__pyx_k_lenpoints), 0, 0, 1, 1},
  {&__pyx_n_u_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 1, 0, 1},
  {&__pyx_n_u_linear, __pyx_k_linear, sizeof(__pyx_k_linear), 0, 1, 0, 1},
  {&__pyx_n_s_linspace, __pyx_k_linspace, sizeof(__pyx_k_linspace), 0, 0, 1, 1},
  {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1},
  {&__pyx_n_s_log10, __pyx_k_log10, sizeof(__pyx_k_log10), 0, 0, 1, 1},
  {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_s_m2f, __pyx_k_m2f, sizeof(__pyx_k_m2f), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
  {&__pyx_n_s_mapn_between, __pyx_k_mapn_between, sizeof(__pyx_k_mapn_between), 0, 0, 1, 1},
  {&__pyx_n_s_mapn_between_2, __pyx_k_mapn_between_2, sizeof(__pyx_k_mapn_between_2), 0, 0, 1, 1},
  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
  {&__pyx_n_s_max_iter, __pyx_k_max_iter, sizeof(__pyx_k_max_iter), 0, 0, 1, 1},
  {&__pyx_n_s_maxzeros, __pyx_k_maxzeros, sizeof(__pyx_k_maxzeros), 0, 0, 1, 1},
  {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1},
  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
  {&__pyx_n_s_min_N_ratio, __pyx_k_min_N_ratio, sizeof(__pyx_k_min_N_ratio), 0, 0, 1, 1},
  {&__pyx_n_s_mix, __pyx_k_mix, sizeof(__pyx_k_mix), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_mul, __pyx_k_mul, sizeof(__pyx_k_mul), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_u_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 1, 0, 1},
  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
  {&__pyx_n_u_nearest, __pyx_k_nearest, sizeof(__pyx_k_nearest), 0, 1, 0, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_new_xs, __pyx_k_new_xs, sizeof(__pyx_k_new_xs), 0, 0, 1, 1},
  {&__pyx_n_s_new_ys, __pyx_k_new_ys, sizeof(__pyx_k_new_ys), 0, 0, 1, 1},
  {&__pyx_n_s_newstate, __pyx_k_newstate, sizeof(__pyx_k_newstate), 0, 0, 1, 1},
  {&__pyx_n_s_newxs, __pyx_k_newxs, sizeof(__pyx_k_newxs), 0, 0, 1, 1},
  {&__pyx_n_s_newys, __pyx_k_newys, sizeof(__pyx_k_newys), 0, 0, 1, 1},
  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
  {&__pyx_n_u_nointerpol, __pyx_k_nointerpol, sizeof(__pyx_k_nointerpol), 0, 1, 0, 1},
  {&__pyx_n_s_ntodx, __pyx_k_ntodx, sizeof(__pyx_k_ntodx), 0, 0, 1, 1},
  {&__pyx_n_s_num_segments, __pyx_k_num_segments, sizeof(__pyx_k_num_segments), 0, 0, 1, 1},
  {&__pyx_n_s_numiter, __pyx_k_numiter, sizeof(__pyx_k_numiter), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
  {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
  {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
  {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1},
  {&__pyx_n_s_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
  {&__pyx_n_s_outbound, __pyx_k_outbound, sizeof(__pyx_k_outbound), 0, 0, 1, 1},
  {&__pyx_n_s_outbound0, __pyx_k_outbound0, sizeof(__pyx_k_outbound0), 0, 0, 1, 1},
  {&__pyx_n_s_outbound1, __pyx_k_outbound1, sizeof(__pyx_k_outbound1), 0, 0, 1, 1},
  {&__pyx_n_s_outbound_mode, __pyx_k_outbound_mode, sizeof(__pyx_k_outbound_mode), 0, 0, 1, 1},
  {&__pyx_n_s_outbound_set, __pyx_k_outbound_set, sizeof(__pyx_k_outbound_set), 0, 0, 1, 1},
  {&__pyx_n_s_outerror, __pyx_k_outerror, sizeof(__pyx_k_outerror), 0, 0, 1, 1},
  {&__pyx_n_s_oversample, __pyx_k_oversample, sizeof(__pyx_k_oversample), 0, 0, 1, 1},
  {&__pyx_n_s_p0, __pyx_k_p0, sizeof(__pyx_k_p0), 0, 0, 1, 1},
  {&__pyx_n_s_p1, __pyx_k_p1, sizeof(__pyx_k_p1), 0, 0, 1, 1},
  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
  {&__pyx_n_s_periodic, __pyx_k_periodic, sizeof(__pyx_k_periodic), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_plot, __pyx_k_plot, sizeof(__pyx_k_plot), 0, 0, 1, 1},
  {&__pyx_n_s_plot_coords, __pyx_k_plot_coords, sizeof(__pyx_k_plot_coords), 0, 0, 1, 1},
  {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 0, 0, 1, 1},
  {&__pyx_n_s_preapply, __pyx_k_preapply, sizeof(__pyx_k_preapply), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qrx, __pyx_k_qrx, sizeof(__pyx_k_qrx), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_rand, __pyx_k_rand, sizeof(__pyx_k_rand), 0, 0, 1, 1},
  {&__pyx_n_s_randint, __pyx_k_randint, sizeof(__pyx_k_randint), 0, 0, 1, 1},
  {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_removepoint, __pyx_k_removepoint, sizeof(__pyx_k_removepoint), 0, 0, 1, 1},
  {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1},
  {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1},
  {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
  {&__pyx_n_s_rtol, __pyx_k_rtol, sizeof(__pyx_k_rtol), 0, 0, 1, 1},
  {&__pyx_n_s_rx, __pyx_k_rx, sizeof(__pyx_k_rx), 0, 0, 1, 1},
  {&__pyx_n_s_sample_between, __pyx_k_sample_between, sizeof(__pyx_k_sample_between), 0, 0, 1, 1},
  {&__pyx_n_s_sampled, __pyx_k_sampled, sizeof(__pyx_k_sampled), 0, 0, 1, 1},
  {&__pyx_n_s_sampled_between, __pyx_k_sampled_between, sizeof(__pyx_k_sampled_between), 0, 0, 1, 1},
  {&__pyx_n_s_samples, __pyx_k_samples, sizeof(__pyx_k_samples), 0, 0, 1, 1},
  {&__pyx_n_s_scipy_interpolate, __pyx_k_scipy_interpolate, sizeof(__pyx_k_scipy_interpolate), 0, 0, 1, 1},
  {&__pyx_n_s_segments, __pyx_k_segments, sizeof(__pyx_k_segments), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_setA4, __pyx_k_setA4, sizeof(__pyx_k_setA4), 0, 0, 1, 1},
  {&__pyx_n_s_set_bounds, __pyx_k_set_bounds, sizeof(__pyx_k_set_bounds), 0, 0, 1, 1},
  {&__pyx_n_s_set_interpolation, __pyx_k_set_interpolation, sizeof(__pyx_k_set_interpolation), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_s_shift, __pyx_k_shift, sizeof(__pyx_k_shift), 0, 0, 1, 1},
  {&__pyx_n_s_shifted, __pyx_k_shifted, sizeof(__pyx_k_shifted), 0, 0, 1, 1},
  {&__pyx_n_s_show, __pyx_k_show, sizeof(__pyx_k_show), 0, 0, 1, 1},
  {&__pyx_n_s_sin, __pyx_k_sin, sizeof(__pyx_k_sin), 0, 0, 1, 1},
  {&__pyx_n_s_sinh, __pyx_k_sinh, sizeof(__pyx_k_sinh), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_slice, __pyx_k_slice, sizeof(__pyx_k_slice), 0, 0, 1, 1},
  {&__pyx_n_s_sliced, __pyx_k_sliced, sizeof(__pyx_k_sliced), 0, 0, 1, 1},
  {&__pyx_n_s_slope, __pyx_k_slope, sizeof(__pyx_k_slope), 0, 0, 1, 1},
  {&__pyx_n_u_smooth, __pyx_k_smooth, sizeof(__pyx_k_smooth), 0, 1, 0, 1},
  {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_u_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 1, 0, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_n_s_stretch, __pyx_k_stretch, sizeof(__pyx_k_stretch), 0, 0, 1, 1},
  {&__pyx_n_s_stretched, __pyx_k_stretched, sizeof(__pyx_k_stretched), 0, 0, 1, 1},
  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_tan, __pyx_k_tan, sizeof(__pyx_k_tan), 0, 0, 1, 1},
  {&__pyx_n_s_tanh, __pyx_k_tanh, sizeof(__pyx_k_tanh), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_kp_u_the_stretch_factor_cannot_be_0, __pyx_k_the_stretch_factor_cannot_be_0, sizeof(__pyx_k_the_stretch_factor_cannot_be_0), 0, 1, 0, 0},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_trapz_integrate_between, __pyx_k_trapz_integrate_between, sizeof(__pyx_k_trapz_integrate_between), 0, 0, 1, 1},
  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
  {&__pyx_n_s_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 0, 0, 1, 1},
  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_which, __pyx_k_which, sizeof(__pyx_k_which), 0, 0, 1, 1},
  {&__pyx_n_s_wrap, __pyx_k_wrap, sizeof(__pyx_k_wrap), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_x0, __pyx_k_x0, sizeof(__pyx_k_x0), 0, 0, 1, 1},
  {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1},
  {&__pyx_n_s_xa, __pyx_k_xa, sizeof(__pyx_k_xa), 0, 0, 1, 1},
  {&__pyx_n_s_xb, __pyx_k_xb, sizeof(__pyx_k_xb), 0, 0, 1, 1},
  {&__pyx_n_s_xend, __pyx_k_xend, sizeof(__pyx_k_xend), 0, 0, 1, 1},
  {&__pyx_n_s_xs, __pyx_k_xs, sizeof(__pyx_k_xs), 0, 0, 1, 1},
  {&__pyx_kp_u_xs_and_ys_must_be_of_equal_lengt, __pyx_k_xs_and_ys_must_be_of_equal_lengt, sizeof(__pyx_k_xs_and_ys_must_be_of_equal_lengt), 0, 1, 0, 0},
  {&__pyx_n_s_xstart, __pyx_k_xstart, sizeof(__pyx_k_xstart), 0, 0, 1, 1},
  {&__pyx_n_s_xtol, __pyx_k_xtol, sizeof(__pyx_k_xtol), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_y0, __pyx_k_y0, sizeof(__pyx_k_y0), 0, 0, 1, 1},
  {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1},
  {&__pyx_n_s_ys, __pyx_k_ys, sizeof(__pyx_k_ys), 0, 0, 1, 1},
  {&__pyx_kp_u_zero_of_function_cannot_be_found, __pyx_k_zero_of_function_cannot_be_found, sizeof(__pyx_k_zero_of_function_cannot_be_found), 0, 1, 0, 0},
  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 105, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 132, __pyx_L1_error)
  __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 351, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 769, __pyx_L1_error)
  __pyx_builtin_ZeroDivisionError = __Pyx_GetBuiltinName(__pyx_n_s_ZeroDivisionError); if (!__pyx_builtin_ZeroDivisionError) __PYX_ERR(0, 786, __pyx_L1_error)
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 830, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 1921, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 2563, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 3069, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 3322, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error)
  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "bpf4/core.pyx":764
 *             v = float(b)  # are we a?
 *             if v == 0:
 *                 return Const(0).set_bounds(a.x0, a.x1)             # <<<<<<<<<<<<<<
 *             elif v == 1:
 *                 return a
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "bpf4/core.pyx":786
 *             v = float(b)  # are we a?
 *             if v == 0:
 *                 raise ZeroDivisionError("Can't divide by 0")             # <<<<<<<<<<<<<<
 *             elif v == 1:
 *                 return a
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Can_t_divide_by_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "bpf4/core.pyx":829
 *             if callable(a):
 *                 return _BpfLambdaPow(_FunctionWrap(a), b, b.bounds())
 *             return _BpfLambdaRPowConst(b, a, (INFNEG, INF))             # <<<<<<<<<<<<<<
 *         return NotImplemented
 * 
 */
  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_float_neg_inf, __pyx_float_inf); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "bpf4/core.pyx":1425
 * 
 *         if self._x0 == INFNEG:
 *             raise ValueError("Cannot integrate a function with an infinite negative bound")             # <<<<<<<<<<<<<<
 *         return _BpfIntegrate(self)
 * 
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Cannot_integrate_a_function_with); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "bpf4/core.pyx":1810
 *         """
 *         if rx == 0:
 *             raise ValueError("the stretch factor cannot be 0")             # <<<<<<<<<<<<<<
 * 
 *         if self._x0 == INF or self._x0 == INFNEG or self._x1 == INF or self._x1 == INFNEG:
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_the_stretch_factor_cannot_be_0); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 1810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "bpf4/core.pyx":1853
 *         cdef double rx
 *         if self._x0 == INF or self._x0 == INFNEG or self._x1 == INF or self._x1 == INFNEG:
 *             raise ValueError("This bpf is unbounded, cannot be fitted."             # <<<<<<<<<<<<<<
 *                              "Use thisbpf[x0:x1].fit_between(...)")
 *         rx = (self._x1 - self._x0) / (x1 - x0)
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_This_bpf_is_unbounded_cannot_be); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "bpf4/core.pyx":1922
 *             return self._slice(x0, x1)
 *         except AttributeError:
 *             raise ValueError("BPFs accept only slices, not single items.")             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_BPFs_accept_only_slices_not_sing); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 1922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "bpf4/core.pyx":1953
 *             # (x0, y0), (x1, y1), ...
 *             data = numpy.asarray(points, dtype=DTYPE)
 *             return cls(data[:,0], data[:,1], **kws)             # <<<<<<<<<<<<<<
 *         else:
 *             # x0, y0, x1, y1, ...
 */
  __pyx_slice__14 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 1953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__14);
  __Pyx_GIVEREF(__pyx_slice__14);
  __pyx_tuple__15 = PyTuple_Pack(2, __pyx_slice__14, __pyx_int_0); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);
  __pyx_tuple__16 = PyTuple_Pack(2, __pyx_slice__14, __pyx_int_1); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "bpf4/core.pyx":1958
 *             lenpoints = len(points)
 *             if lenpoints % 2 != 0:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "The instantiation form x0, y0, x1, y1 should have an even number of args"
 *                 )
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_The_instantiation_form_x0_y0_x1); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "bpf4/core.pyx":1964
 *                 return cls((points[0], points[1]), (points[0], points[1]), **kws)
 *             elif lenpoints == 1:
 *                 return cls((0, 0), (0, points[0]), **kws)             # <<<<<<<<<<<<<<
 *             else:
 *                 return cls(points[::2], points[1::2], **kws)
 */
  __pyx_tuple__18 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "bpf4/core.pyx":1966
 *                 return cls((0, 0), (0, points[0]), **kws)
 *             else:
 *                 return cls(points[::2], points[1::2], **kws)             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
 */
  __pyx_slice__19 = PySlice_New(Py_None, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__19)) __PYX_ERR(0, 1966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__19);
  __Pyx_GIVEREF(__pyx_slice__19);
  __pyx_slice__20 = PySlice_New(__pyx_int_1, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 1966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__20);
  __Pyx_GIVEREF(__pyx_slice__20);

  /* "bpf4/core.pyx":2055
 *                              "and ys has %d items" % (len_xs, len_ys))
 *         if len_xs < 1:
 *             raise ValueError("Can't creat a BPF of 0 points")             # <<<<<<<<<<<<<<
 *         self.xs = _xs
 *         self.ys = _ys
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Can_t_creat_a_BPF_of_0_points); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 2055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "bpf4/core.pyx":2280
 *         """
 *         state = self.__getstate__()
 *         newstate = (xs, ys) + state[2:]             # <<<<<<<<<<<<<<
 *         return self.__class__(*newstate)
 * 
 */
  __pyx_slice__25 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(0, 2280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__25);
  __Pyx_GIVEREF(__pyx_slice__25);

  /* "bpf4/core.pyx":2885
 *             self.interpolfunc = InterpolFunc_new_from_descriptor(interpolation)
 *             if self.interpolfunc is NULL:
 *                 raise ValueError("interpolation type not understood")             # <<<<<<<<<<<<<<
 *         self.y0 = self.data[0]
 *         self.y1 = self.data[l - 1]
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_interpolation_type_not_understoo); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 2885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "bpf4/core.pyx":3323
 *             from scipy.interpolate import UnivariateSpline
 *         except ImportError:
 *             raise ImportError("could not import scipy. USpline is a wrapper of UnivariateSpline"             # <<<<<<<<<<<<<<
 *                               " and cant be used without scipy")
 *         self.spline = UnivariateSpline(xs, ys)
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_could_not_import_scipy_USpline_i); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 3323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "bpf4/core.pyx":3647
 *             bpfs.append(other2)
 *             return _BpfConcat(xs, bpfs)
 *         raise NotImplementedError("fade is not implemented")             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self):
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_u_fade_is_not_implemented); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 3647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "bpf4/core.pyx":4703
 *         self.oversample = oversample if oversample > 0 else CONFIG['integrate.oversample']
 *         if x0 == INFNEG or x0 == INF:
 *             raise ValueError("cannot integrate a function with an infinite lower bound")             # <<<<<<<<<<<<<<
 *         self.debug = 0
 * 
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_cannot_integrate_a_function_with); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 4703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "bpf4/core.pyx":5178
 *     result = _bpf_brentq(bpf, x0, xa, xb, &outerror, xtol, rtol, max_iter, &funcalls)
 *     if outerror:
 *         raise ValueError("zero of function cannot be found within the interval given")             # <<<<<<<<<<<<<<
 *     return result, funcalls
 * 
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u_zero_of_function_cannot_be_found); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 5178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":945
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "../../../.virtualenvs/em9/lib/python3.9/site-packages/numpy/__init__.pxd":951
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_double____double____nogil_to_py")
 * cdef object __Pyx_CFunc_double____double____nogil_to_py(double (*f)(double) except *):
 *     def wrap(double x):             # <<<<<<<<<<<<<<
 *         """wrap(x: float) -> float"""
 *         return f(x)
 */
  __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_x); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(2, 65, __pyx_L1_error)

  /* "View.MemoryView":133
 * 
 *         if not self.ndim:
 *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if itemsize <= 0:
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "View.MemoryView":136
 * 
 *         if itemsize <= 0:
 *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(format, bytes):
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "View.MemoryView":148
 * 
 *         if not self._shape:
 *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "View.MemoryView":176
 *             self.data = <char *>malloc(self.len)
 *             if not self.data:
 *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_is_object:
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "View.MemoryView":192
 *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *         if not (flags & bufmode):
 *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
 *         info.buf = self.data
 *         info.len = self.len
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "View.MemoryView":418
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:
 *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
 * 
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "View.MemoryView":495
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
 *         else:
 *             if len(self.view.format) == 1:
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "View.MemoryView":520
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
 *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_ND:
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(2, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "View.MemoryView":570
 *         if self.view.strides == NULL:
 * 
 *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
 * 
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(2, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "View.MemoryView":577
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 */
  __pyx_tuple__53 = PyTuple_New(1); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(2, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_tuple__53, 0, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(2, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "View.MemoryView":703
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(2, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(2, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "bpf4/core.pyx":84
 * # ---------------------------- init
 * import_array()
 * srand(random.randint(0, 99999))             # <<<<<<<<<<<<<<
 * 
 * # ---------------------------- platform specific constants
 */
  __pyx_tuple__59 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_99999); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "bpf4/core.pyx":105
 * #       ERROR TYPES
 * # -------------------------------------------------------------------
 * class BpfPointsError(ValueError): pass             # <<<<<<<<<<<<<<
 * class BpfInversionError(ValueError): pass
 * 
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "bpf4/core.pyx":106
 * # -------------------------------------------------------------------
 * class BpfPointsError(ValueError): pass
 * class BpfInversionError(ValueError): pass             # <<<<<<<<<<<<<<
 * 
 * # -------------------------------------------------------------------
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "bpf4/core.pyx":357
 * 
 * 
 * def setA4(double freq):             # <<<<<<<<<<<<<<
 *     """
 *     Set the reference freq used
 */
  __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_freq, __pyx_n_s_freq); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_setA4, 357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 357, __pyx_L1_error)

  /* "bpf4/core.pyx":518
 * DEF INFNEG = float('-inf')
 * cdef double MAX_FLOAT = 3.40282346638528860e+38
 * CONST_XS_FOR_RENDERING = numpy.linspace(0., 1., NUM_XS_FOR_RENDERING)             # <<<<<<<<<<<<<<
 * DEF NOCOPY = False
 * 
 */
  __pyx_tuple__64 = PyTuple_Pack(3, __pyx_float_0_, __pyx_float_1_, __pyx_int_200); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "bpf4/core.pyx":528
 * 
 * 
 * cpdef int _array_issorted(double[:] xs):             # <<<<<<<<<<<<<<
 *     """
 *     Is this array sorted?
 */
  __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_xs, __pyx_n_s_xs); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);
  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_array_issorted, 528, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 528, __pyx_L1_error)

  /* "bpf4/core.pyx":642
 *     return out
 * 
 * def _get_bounds(a, b):             # <<<<<<<<<<<<<<
 *     cdef double start, end, b_start, b_end
 *     start, end = a.bounds()
 */
  __pyx_tuple__67 = PyTuple_Pack(6, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_b_start, __pyx_n_s_b_end); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);
  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_get_bounds, 642, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 642, __pyx_L1_error)

  /* "bpf4/core.pyx":668
 *     cdef double _x0, _x1
 *     cdef int _integration_mode  # 0: dont use scipy, 1: use scipy, -1: calibrate
 *     cpdef BpfInterface _asbpf(self): return self             # <<<<<<<<<<<<<<
 *     cdef void _bounds_changed(self): pass
 * 
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_asbpf, 668, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 668, __pyx_L1_error)

  /* "bpf4/core.pyx":679
 *         self._set_bounds(a._x0, a._x1)
 * 
 *     cpdef double ntodx(self, int N):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the sampling period `dx`
 */
  __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_N, __pyx_n_s_N); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);
  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_ntodx, 679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 679, __pyx_L1_error)

  /* "bpf4/core.pyx":695
 *         return (self._x1 - self._x0) / (N - 1)
 * 
 *     cpdef int dxton(self, double dx):             # <<<<<<<<<<<<<<
 *         """
 *         Split the bounds of this bpf according to a given sampling period *dx*
 */
  __pyx_tuple__73 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dx, __pyx_n_s_dx); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);
  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_dxton, 695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 695, __pyx_L1_error)

  /* "bpf4/core.pyx":717
 *         return <int>(((self._x1 + dx) - self._x0) / dx)
 * 
 *     def bounds(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple (xstart, xend) representing the bounds of this bpf
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);
  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_bounds, 717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 717, __pyx_L1_error)

  /* "bpf4/core.pyx":884
 *             return _create_lambda(self, other, _BpfLambdaGreaterOrEqualThan, _BpfLambdaGreaterOrEqualThanConst) # (self < other) == 0
 * 
 *     def _get_points_for_rendering(self, int n= -1):             # <<<<<<<<<<<<<<
 *         # BpfInterface
 *         if n == -1:
 */
  __pyx_tuple__77 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_xs, __pyx_n_s_ys); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);
  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_get_points_for_rendering, 884, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 884, __pyx_L1_error)

  /* "bpf4/core.pyx":892
 *         return xs, ys
 * 
 *     def render(self, xs, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new bpf representing this bpf rendered at the given points
 */
  __pyx_tuple__79 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_xs, __pyx_n_s_interpolation, __pyx_n_s_dx, __pyx_n_s_ys); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);
  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_render, 892, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 892, __pyx_L1_error)

  /* "bpf4/core.pyx":946
 *                 raise ValueError("interpolation %s not implemented" % interpolation)
 * 
 *     def plot(self, kind='line', int n=-1, show=True, axes=None, **keys):             # <<<<<<<<<<<<<<
 *         """
 *         Plot the bpf. Any key is passed to plot.plot_coords
 */
  __pyx_tuple__81 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_kind, __pyx_n_s_n, __pyx_n_s_show, __pyx_n_s_axes, __pyx_n_s_keys, __pyx_n_s_xs, __pyx_n_s_ys, __pyx_n_s_plot); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);
  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_plot, 946, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 946, __pyx_L1_error)

  /* "bpf4/core.pyx":978
 *         plot.plot_coords(xs, ys, kind=kind, show=show, axes=axes, **keys)
 * 
 *     cpdef BpfInterface sampled(self, double dx, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Sample this bpf at a regular interval, returns a Sampled bpf
 */
  __pyx_tuple__83 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dx, __pyx_n_s_interpolation); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);
  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_sampled, 978, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 978, __pyx_L1_error)

  /* "bpf4/core.pyx":1015
 *         return Sampled(ys, dx=dx, x0=self._x0, interpolation=interpolation)
 * 
 *     cpdef ndarray sample_between(self, double x0, double x1, double dx, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sample this bpf at an interval of dx between x0 and x1
 */
  __pyx_tuple__85 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_dx, __pyx_n_s_out); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);
  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_sample_between, 1015, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 1015, __pyx_L1_error)

  /* "bpf4/core.pyx":1049
 *         return self.mapn_between(n, x0, x1, out)
 * 
 *     cpdef BpfInterface sampled_between(self, double x0, double x1, double dx, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Sample a portion of this bpf, returns a `Sampled` bpf
 */
  __pyx_tuple__87 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_dx, __pyx_n_s_interpolation); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);
  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_sampled_between, 1049, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 1049, __pyx_L1_error)

  /* "bpf4/core.pyx":1072
 *         return Sampled(ys, dx=dx, x0=x0, interpolation=interpolation)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate an array of `n` values representing this bpf between `x0` and `x1`
 */
  __pyx_tuple__89 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);
  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 1072, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 1072, __pyx_L1_error)

  /* "bpf4/core.pyx":1106
 *         return numpy.asarray(result)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         The same as map(self, xs) but faster
 */
  __pyx_tuple__91 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xs, __pyx_n_s_out); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 1106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);
  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_map, 1106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 1106, __pyx_L1_error)

  /* "bpf4/core.pyx":1147
 *         return numpy.asarray(result)
 * 
 *     cpdef BpfInterface concat(self, BpfInterface other):             # <<<<<<<<<<<<<<
 *         """
 *         Concatenate this bpf to other
 */
  __pyx_tuple__93 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_concat, 1147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 1147, __pyx_L1_error)

  /* "bpf4/core.pyx":1172
 *         return _BpfConcat2_new(self, other2, other2._x0)
 * 
 *     cpdef _BpfLambdaRound round(self):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf representing round(self(x))
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);
  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_round, 1172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 1172, __pyx_L1_error)

  /* "bpf4/core.pyx":1181
 *         return _BpfLambdaRound(self)
 * 
 *     cpdef _BpfRand rand(self):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf representing rand(self(x))
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_rand, 1181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 1181, __pyx_L1_error)

  /* "bpf4/core.pyx":1190
 *         return _BpfRand(self)
 * 
 *     cpdef _BpfUnaryFunc cos(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the cosine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 0)
 */
  __pyx_tuple__99 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 1190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_cos, 1190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 1190, __pyx_L1_error)

  /* "bpf4/core.pyx":1194
 *         return _BpfUnaryFunc_new_from_index(self, 0)
 * 
 *     cpdef _BpfUnaryFunc sin(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the sine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 1)
 */
  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_sin, 1194, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 1194, __pyx_L1_error)

  /* "bpf4/core.pyx":1198
 *         return _BpfUnaryFunc_new_from_index(self, 1)
 * 
 *     cpdef _BpfUnaryFunc ceil(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the ceil of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 2)
 */
  __pyx_tuple__103 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_ceil, 1198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 1198, __pyx_L1_error)

  /* "bpf4/core.pyx":1202
 *         return _BpfUnaryFunc_new_from_index(self, 2)
 * 
 *     cpdef _BpfUnaryFunc expon(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the exp operation with this bpf
 * 
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_expon, 1202, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 1202, __pyx_L1_error)

  /* "bpf4/core.pyx":1220
 *         return _BpfUnaryFunc_new_from_index(self, 4)
 * 
 *     cpdef _BpfUnaryFunc floor(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the floor of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 5)
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 1220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_floor, 1220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 1220, __pyx_L1_error)

  /* "bpf4/core.pyx":1224
 *         return _BpfUnaryFunc_new_from_index(self, 5)
 * 
 *     cpdef _BpfUnaryFunc tanh(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the tanh of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 6)
 */
  __pyx_tuple__109 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_tanh, 1224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 1224, __pyx_L1_error)

  /* "bpf4/core.pyx":1228
 *         return _BpfUnaryFunc_new_from_index(self, 6)
 * 
 *     cpdef _BpfUnaryFunc abs(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the absolute value of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 7)
 */
  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_abs, 1228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 1228, __pyx_L1_error)

  /* "bpf4/core.pyx":1232
 *         return _BpfUnaryFunc_new_from_index(self, 7)
 * 
 *     cpdef _BpfUnaryFunc sqrt(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the sqrt of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 8)
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);
  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_sqrt, 1232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 1232, __pyx_L1_error)

  /* "bpf4/core.pyx":1236
 *         return _BpfUnaryFunc_new_from_index(self, 8)
 * 
 *     cpdef _BpfUnaryFunc acos(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the arc cosine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 9)
 */
  __pyx_tuple__115 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_acos, 1236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 1236, __pyx_L1_error)

  /* "bpf4/core.pyx":1240
 *         return _BpfUnaryFunc_new_from_index(self, 9)
 * 
 *     cpdef _BpfUnaryFunc asin(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the arc sine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 10)
 */
  __pyx_tuple__117 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);
  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_asin, 1240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 1240, __pyx_L1_error)

  /* "bpf4/core.pyx":1244
 *         return _BpfUnaryFunc_new_from_index(self, 10)
 * 
 *     cpdef _BpfUnaryFunc tan(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the tan of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 11)
 */
  __pyx_tuple__119 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);
  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_tan, 1244, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 1244, __pyx_L1_error)

  /* "bpf4/core.pyx":1248
 *         return _BpfUnaryFunc_new_from_index(self, 11)
 * 
 *     cpdef _BpfUnaryFunc sinh(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the sinh of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 12)
 */
  __pyx_tuple__121 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 1248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_sinh, 1248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 1248, __pyx_L1_error)

  /* "bpf4/core.pyx":1252
 *         return _BpfUnaryFunc_new_from_index(self, 12)
 * 
 *     cpdef _BpfUnaryFunc log10(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the log10 of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 13)
 */
  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);
  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_log10, 1252, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 1252, __pyx_L1_error)

  /* "bpf4/core.pyx":1256
 *         return _BpfUnaryFunc_new_from_index(self, 13)
 * 
 *     cpdef _BpfLambdaLog log(self, double base=M_E):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing the log of this bpf
 */
  __pyx_tuple__125 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_base); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);
  __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_log, 1256, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 1256, __pyx_L1_error)

  /* "bpf4/core.pyx":1269
 *         return _BpfLambdaLog(self, base, self.bounds())
 * 
 *     cpdef _BpfM2F m2f(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf converting from midinotes to frequency
 * 
 */
  __pyx_tuple__127 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);
  __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_m2f, 1269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 1269, __pyx_L1_error)

  /* "bpf4/core.pyx":1289
 *         return _BpfM2F(self)
 * 
 *     cpdef _BpfF2M f2m(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf converting frequencies to midinotes
 * 
 */
  __pyx_tuple__129 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);
  __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_f2m, 1289, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 1289, __pyx_L1_error)

  /* "bpf4/core.pyx":1307
 *         return _BpfF2M(self)
 * 
 *     cpdef _Bpf_db2amp db2amp(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf converting decibels to linear amplitudes
 */
  __pyx_tuple__131 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);
  __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_db2amp, 1307, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 1307, __pyx_L1_error)

  /* "bpf4/core.pyx":1324
 *         return _Bpf_db2amp(self)
 * 
 *     cpdef _Bpf_amp2db amp2db(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf converting linear amplitudes to decibels
 */
  __pyx_tuple__133 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);
  __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_amp2db, 1324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 1324, __pyx_L1_error)

  /* "bpf4/core.pyx":1342
 *         return _Bpf_amp2db(self)
 * 
 *     cpdef _BpfLambdaClip clip(self, double y0=INFNEG, double y1=INF):             # <<<<<<<<<<<<<<
 *         """
 *         Return a bpf clipping the result between y0 and y1
 */
  __pyx_tuple__135 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_y0, __pyx_n_s_y1); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);
  __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_clip, 1342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 1342, __pyx_L1_error)

  /* "bpf4/core.pyx":1368
 *         return _BpfLambdaClip_new(self, y0, y1)
 * 
 *     cpdef BpfInterface derivative(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create a curve which represents the derivative of this curve
 */
  __pyx_tuple__137 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);
  __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_derivative, 1368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 1368, __pyx_L1_error)

  /* "bpf4/core.pyx":1401
 *         return _BpfDeriv(self)
 * 
 *     cpdef BpfInterface integrated(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a bpf representing the integration of this bpf at a given point
 */
  __pyx_tuple__139 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);
  __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrated, 1401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 1401, __pyx_L1_error)

  /* "bpf4/core.pyx":1428
 *         return _BpfIntegrate(self)
 * 
 *     cpdef double integrate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the result of the integration of this bpf.
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);
  __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate, 1428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 1428, __pyx_L1_error)

  /* "bpf4/core.pyx":1452
 *         return self.integrate_between(self._x0, self._x1)
 * 
 *     cpdef double trapz_integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between [x0, x1] using the trapt method
 */
  __pyx_tuple__143 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 1452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);
  __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_trapz_integrate_between, 1452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 1452, __pyx_L1_error)

  /* "bpf4/core.pyx":1476
 *         return _integr_trapz(&ys[0], ys.shape[0], dx)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between x0 and x1
 */
  __pyx_tuple__145 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 1476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);
  __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate_between, 1476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 1476, __pyx_L1_error)

  /* "bpf4/core.pyx":1512
 *         return outbound0 + inbound + outbound1
 * 
 *     cpdef double mean(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the mean value of this bpf.
 */
  __pyx_tuple__147 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);
  __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mean, 1512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(0, 1512, __pyx_L1_error)

  /* "bpf4/core.pyx":1529
 *         return self.integrate() / (self._x1 - self._x0)
 * 
 *     cpdef list zeros(self, double h=0.01, int N=0, double x0=NAN, double x1=NAN, int maxzeros=0):             # <<<<<<<<<<<<<<
 *         """
 *         Find the zeros of this bpf
 */
  __pyx_tuple__149 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_h, __pyx_n_s_N, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_maxzeros); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);
  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_zeros, 1529, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 1529, __pyx_L1_error)

  /* "bpf4/core.pyx":1560
 *         return bpf_zero_crossings(self, h=h, N=N, x0=x0, x1=x1, maxzeros=maxzeros)
 * 
 *     def max(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing `max(self, b)`
 */
  __pyx_tuple__151 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_b); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);
  __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_max, 1560, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 1560, __pyx_L1_error)

  /* "bpf4/core.pyx":1588
 *         return _BpfMaxConst(self, b, self.bounds())
 * 
 *     def min(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing `min(self, b)`
 */
  __pyx_tuple__153 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_b); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);
  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_min, 1588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 1588, __pyx_L1_error)

  /* "bpf4/core.pyx":1615
 *         return _BpfMinConst(self, b, self.bounds())
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), self.__getstate__()
 * 
 */
  __pyx_tuple__155 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 1615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);
  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_reduce, 1615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 1615, __pyx_L1_error)

  /* "bpf4/core.pyx":1633
 *         return self.__ccall__(x)
 * 
 *     def keep_slope(self, double epsilon=DEFAULT_EPSILON):             # <<<<<<<<<<<<<<
 *         """
 *         A view of this bpf where the slope is continued outside its bounds
 */
  __pyx_tuple__157 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_epsilon); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);
  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_keep_slope, 1633, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 1633, __pyx_L1_error)

  /* "bpf4/core.pyx":1664
 *         return _BpfKeepSlope(self, epsilon)
 * 
 *     def outbound(self, double y0, double y1):             # <<<<<<<<<<<<<<
 *         """
 *         Return a new Bpf with the given values outside the bounds
 */
  __pyx_tuple__159 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_y0, __pyx_n_s_y1); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);
  __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_outbound, 1664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 1664, __pyx_L1_error)

  /* "bpf4/core.pyx":1691
 *         return _BpfCrop_new(self, self._x0, self._x1, OUTBOUND_SET, y0, y1)
 * 
 *     def apply(self, func):             # <<<<<<<<<<<<<<
 *         """
 *         Create a bpf where `func` is applied to the result of this pdf
 */
  __pyx_tuple__161 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_func); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);
  __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_apply, 1691, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 1691, __pyx_L1_error)

  /* "bpf4/core.pyx":1723
 *         return _BpfCompose_new(self, _FunctionWrap(func))
 * 
 *     def preapply(self, func):             # <<<<<<<<<<<<<<
 *         """
 *         Create a bpf where `func` is applied to the argument before it is passed
 */
  __pyx_tuple__163 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_func); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);
  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_preapply, 1723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 1723, __pyx_L1_error)

  /* "bpf4/core.pyx":1753
 *         return _BpfCompose_new(_FunctionWrap(func), self)
 * 
 *     def periodic(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new bpf which replicates this in a periodic way
 */
  __pyx_tuple__165 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);
  __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_periodic, 1753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(0, 1753, __pyx_L1_error)

  /* "bpf4/core.pyx":1777
 *         return _BpfPeriodic(self)
 * 
 *     def stretched(self, double rx, double fixpoint=0.):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a view of this bpf stretched over the x axis.
 */
  __pyx_tuple__167 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_rx, __pyx_n_s_fixpoint, __pyx_n_s_qrx, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_p0, __pyx_n_s_p1); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 1777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);
  __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_stretched, 1777, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(0, 1777, __pyx_L1_error)

  /* "bpf4/core.pyx":1822
 *         return self.fit_between(p0, p1)
 * 
 *     cpdef BpfInterface fit_between(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a view of this bpf fitted within the interval `x0:x1`
 */
  __pyx_tuple__169 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);
  __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_fit_between, 1822, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 1822, __pyx_L1_error)

  /* "bpf4/core.pyx":1861
 * 
 * 
 *     cpdef BpfInterface shifted(self, dx):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a view of this bpf shifted by `dx` over the x-axes
 */
  __pyx_tuple__171 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dx); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 1861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);
  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_shifted, 1861, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 1861, __pyx_L1_error)

  /* "bpf4/core.pyx":1879
 *         return _BpfProjection(self, rx=1, dx=-dx)
 * 
 *     def inverted(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view on this bpf with the coords inverted
 */
  __pyx_tuple__173 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 1879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);
  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_inverted, 1879, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 1879, __pyx_L1_error)

  /* "bpf4/core.pyx":1905
 *             return None
 * 
 *     cpdef BpfInterface _slice(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         return _BpfCrop_new(self, x0, x1, OUTBOUND_DEFAULT, 0, 0)
 * 
 */
  __pyx_tuple__175 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);
  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_slice, 1905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 1905, __pyx_L1_error)

  /* "bpf4/core.pyx":1925
 * 
 *     @classmethod
 *     def fromseq(cls, *points, **kws):             # <<<<<<<<<<<<<<
 *         """
 *         A helper constructor, in this variant points are given as tuples or as a flat sequence.
 */
  __pyx_tuple__177 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_points, __pyx_n_s_kws, __pyx_n_s_data, __pyx_n_s_lenpoints); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 1925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);
  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_fromseq, 1925, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 1925, __pyx_L1_error)

  /* "bpf4/core.pyx":1968
 *                 return cls(points[::2], points[1::2], **kws)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create a copy of this bpf
 */
  __pyx_tuple__179 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);
  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_copy, 1968, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 1968, __pyx_L1_error)

  /* "bpf4/core.pyx":1984
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(x0), str(x1))
 * 
 *     def debug(self, key, value=None):             # <<<<<<<<<<<<<<
 *         """
 *         keys:
 */
  __pyx_tuple__181 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(0, 1984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__181);
  __Pyx_GIVEREF(__pyx_tuple__181);
  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_debug, 1984, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(0, 1984, __pyx_L1_error)

  /* "bpf4/core.pyx":2088
 *             self.outbound1 = (<DTYPE_t *>(self.ys_data))[last_index]
 * 
 *     def outbound(self, double y0, double y1):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values **inplace** returned when this bpf is evaluated outside its bounds.
 */
  __pyx_tuple__183 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_y0, __pyx_n_s_y1); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_outbound, 2088, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 2088, __pyx_L1_error)

  /* "bpf4/core.pyx":2101
 *         return self
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.xs, self.ys)
 * 
 */
  __pyx_tuple__185 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 2101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);
  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 2101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(0, 2101, __pyx_L1_error)

  /* "bpf4/core.pyx":2104
 *         return (self.xs, self.ys)
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.xs, self.ys = state
 * 
 */
  __pyx_tuple__187 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_state); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 2104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_setstate, 2104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 2104, __pyx_L1_error)

  /* "bpf4/core.pyx":2136
 *         return res
 * 
 *     cpdef ndarray mapn_between(self, int n, double xstart, double xend, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)
 *         cdef double dx = _ntodx(n, xstart, xend)
 */
  __pyx_tuple__189 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_xstart, __pyx_n_s_xend, __pyx_n_s_out); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 2136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 2136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 2136, __pyx_L1_error)

  /* "bpf4/core.pyx":2183
 *         return numpy.asarray(result)
 * 
 *     cpdef ndarray _mapn_between(self, int n, double xstart, double xend, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
  __pyx_tuple__191 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_xstart, __pyx_n_s_xend, __pyx_n_s_out); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 2183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);
  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between_2, 2183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(0, 2183, __pyx_L1_error)

  /* "bpf4/core.pyx":2209
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(self._x0), str(self._x1))
 * 
 *     def stretch(self, double rx):             # <<<<<<<<<<<<<<
 *         """
 *         Stretch or compress this bpf in the x-coordinate **INPLACE**
 */
  __pyx_tuple__193 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_rx, __pyx_n_s_rx); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_stretch, 2209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 2209, __pyx_L1_error)

  /* "bpf4/core.pyx":2224
 *         self._recalculate_bounds()
 * 
 *     def shift(self, double dx):             # <<<<<<<<<<<<<<
 *         """
 *         Shift the bpf along the x-coords, **INPLACE**
 */
  __pyx_tuple__195 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dx, __pyx_n_s_dx); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 2224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_shift, 2224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 2224, __pyx_L1_error)

  /* "bpf4/core.pyx":2246
 *         self._invalidate_cache()
 * 
 *     def points(BpfBase self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple with the points defining this bpf
 */
  __pyx_tuple__197 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 2246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);
  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_points, 2246, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(0, 2246, __pyx_L1_error)

  /* "bpf4/core.pyx":2267
 *         return self.xs, self.ys
 * 
 *     def clone_with_new_data(self, xs: ndarray, ys: ndarray) -> BpfInterface:             # <<<<<<<<<<<<<<
 *         """
 *         Create a new bpf with the same attributes as self but with new data
 */
  __pyx_tuple__199 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_xs, __pyx_n_s_ys, __pyx_n_s_state, __pyx_n_s_newstate); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(0, 2267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);
  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_clone_with_new_data, 2267, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(0, 2267, __pyx_L1_error)

  /* "bpf4/core.pyx":2283
 *         return self.__class__(*newstate)
 * 
 *     def insertpoint(self, double x, double y):             # <<<<<<<<<<<<<<
 *         """
 *         Return **a copy** of this bpf with the point `(x, y)` inserted
 */
  __pyx_tuple__201 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_index, __pyx_n_s_new_xs, __pyx_n_s_new_ys); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 2283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_insertpoint, 2283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(0, 2283, __pyx_L1_error)

  /* "bpf4/core.pyx":2303
 *         return self.clone_with_new_data(new_xs, new_ys)
 * 
 *     def removepoint(self, double x):             # <<<<<<<<<<<<<<
 *         """
 *         Return a copy of this bpf with point at x removed
 */
  __pyx_tuple__203 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_x, __pyx_n_s_index, __pyx_n_s_newxs, __pyx_n_s_newys); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(0, 2303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);
  __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_removepoint, 2303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) __PYX_ERR(0, 2303, __pyx_L1_error)

  /* "bpf4/core.pyx":2333
 *         return self.clone_with_new_data(newxs, newys)
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return an iterator over the segments of this bpf
 */
  __pyx_tuple__205 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_num_segments, __pyx_n_s_interpoltype); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(0, 2333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);
  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_segments, 2333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 2333, __pyx_L1_error)

  /* "bpf4/core.pyx":2382
 *         BpfBase.__init__(self, xs, ys)
 * 
 *     def _get_points_for_rendering(self, int n= -1):             # <<<<<<<<<<<<<<
 *         return self.xs, self.ys
 * 
 */
  __pyx_tuple__206 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 2382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);
  __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_get_points_for_rendering, 2382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 2382, __pyx_L1_error)

  /* "bpf4/core.pyx":2385
 *         return self.xs, self.ys
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between the given x coords
 */
  __pyx_tuple__208 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(0, 2385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__208);
  __Pyx_GIVEREF(__pyx_tuple__208);
  __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__208, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate_between, 2385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(0, 2385, __pyx_L1_error)

  /* "bpf4/core.pyx":2418
 *         return pre + mid + post
 * 
 *     cpdef Linear sliced(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         """
 *         Cut this bpf at the given points
 */
  __pyx_tuple__210 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 2418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);
  __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_sliced, 2418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(0, 2418, __pyx_L1_error)

  /* "bpf4/core.pyx":2438
 *         return Linear(X, Y)
 * 
 *     def inverted(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a new Linear bpf where x and y coordinates are inverted.
 */
  __pyx_tuple__212 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_res); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 2438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);
  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_inverted, 2438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(0, 2438, __pyx_L1_error)

  /* "bpf4/core.pyx":2455
 *         return Linear(self.ys, self.xs)
 * 
 *     def flatpairs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a flat 1D array with x and y values interlaced
 */
  __pyx_tuple__214 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(0, 2455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);
  __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_flatpairs, 2455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(0, 2455, __pyx_L1_error)

  /* "bpf4/core.pyx":2565
 *         super().__init__(xs, ys)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.xs, self.ys, self.interpol_func.exp, self.interpol_func.numiter
 * 
 */
  __pyx_tuple__216 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(0, 2565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);
  __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 2565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) __PYX_ERR(0, 2565, __pyx_L1_error)

  /* "bpf4/core.pyx":2635
 *         self.interpol_func.numiter = numiter
 * 
 *     def __getstate__(self): return self.xs, self.ys, self.interpol_func.exp             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */
  __pyx_tuple__218 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(0, 2635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);
  __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 2635, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(0, 2635, __pyx_L1_error)

  /* "bpf4/core.pyx":2637
 *     def __getstate__(self): return self.xs, self.ys, self.interpol_func.exp
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.xs, self.ys, exp = state
 *         self.interpol_func.exp = exp
 */
  __pyx_tuple__220 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_exp); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(0, 2637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);
  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_setstate, 2637, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 2637, __pyx_L1_error)

  /* "bpf4/core.pyx":2734
 *         self.interpol_func = InterpolFunc_nearest
 * 
 *     def __getstate__(self): return self.xs, self.ys             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__222 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 2734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);
  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 2734, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(0, 2734, __pyx_L1_error)

  /* "bpf4/core.pyx":2907
 *         return self._cached_xs
 * 
 *     def points(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple with the points defining this bpf
 */
  __pyx_tuple__224 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(0, 2907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);
  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_points, 2907, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 2907, __pyx_L1_error)

  /* "bpf4/core.pyx":2946
 *         return self.grid_dx
 * 
 *     cpdef Sampled set_interpolation(self, str interpolation):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the interpolation of this Sampled bpf, inplace
 */
  __pyx_tuple__226 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_interpolation); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 2946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__226);
  __Pyx_GIVEREF(__pyx_tuple__226);
  __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__226, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_set_interpolation, 2946, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(0, 2946, __pyx_L1_error)

  /* "bpf4/core.pyx":2976
 *         InterpolFunc_free(self.interpolfunc)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.ys, self.grid_dx, self.grid_x0, self.interpolation)
 * 
 */
  __pyx_tuple__228 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(0, 2976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__228);
  __Pyx_GIVEREF(__pyx_tuple__228);
  __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 2976, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(0, 2976, __pyx_L1_error)

  /* "bpf4/core.pyx":3000
 * 
 *     @cython.cdivision(True)
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
  __pyx_tuple__230 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(0, 3000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__230);
  __Pyx_GIVEREF(__pyx_tuple__230);
  __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__230, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 3000, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(0, 3000, __pyx_L1_error)

  /* "bpf4/core.pyx":3069
 * 
 *     @classmethod
 *     def fromseq(cls, *args, **kws): raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def _get_points_for_rendering(self, int n= -1):
 */
  __pyx_tuple__232 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kws); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(0, 3069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__232);
  __Pyx_GIVEREF(__pyx_tuple__232);
  __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_fromseq, 3069, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(0, 3069, __pyx_L1_error)

  /* "bpf4/core.pyx":3071
 *     def fromseq(cls, *args, **kws): raise NotImplementedError
 * 
 *     def _get_points_for_rendering(self, int n= -1):             # <<<<<<<<<<<<<<
 *         return self.xs, self.ys
 * 
 */
  __pyx_tuple__234 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(0, 3071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__234);
  __Pyx_GIVEREF(__pyx_tuple__234);
  __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_get_points_for_rendering, 3071, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(0, 3071, __pyx_L1_error)

  /* "bpf4/core.pyx":3074
 *         return self.xs, self.ys
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */
  __pyx_tuple__236 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_x0, __pyx_n_s_dx, __pyx_n_s_descr, __pyx_n_s_exp); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(0, 3074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__236);
  __Pyx_GIVEREF(__pyx_tuple__236);
  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_segments, 3074, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 3074, __pyx_L1_error)

  /* "bpf4/core.pyx":3095
 *             yield (x0 + i*dx, self.data[i], descr, exp)
 * 
 *     cpdef double integrate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the result of the integration of this bpf.
 */
  __pyx_tuple__237 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(0, 3095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);
  __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate, 3095, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(0, 3095, __pyx_L1_error)

  /* "bpf4/core.pyx":3113
 *         return _integr_trapz(self.data, self.samples_size, self.grid_dx)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         The same as integrate() but between the (included) bounds x0-x1
 */
  __pyx_tuple__239 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(0, 3113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__239);
  __Pyx_GIVEREF(__pyx_tuple__239);
  __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate_between, 3113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(0, 3113, __pyx_L1_error)

  /* "bpf4/core.pyx":3124
 *         return _integr_trapz_between_exact(self.data, self.samples_size, dx, self.grid_x0, x0, x1)
 * 
 *     cpdef BpfInterface derivative(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a curve which represents the derivative of this curve
 */
  __pyx_tuple__241 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(0, 3124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__241);
  __Pyx_GIVEREF(__pyx_tuple__241);
  __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_derivative, 3124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(0, 3124, __pyx_L1_error)

  /* "bpf4/core.pyx":3151
 *         return _BpfDeriv(self, self.grid_dx*0.99)
 * 
 *     def inverted(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view on this bpf with the coords inverted
 */
  __pyx_tuple__243 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(0, 3151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);
  __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_inverted, 3151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(0, 3151, __pyx_L1_error)

  /* "bpf4/core.pyx":3175
 *         return Linear(self.xs, self.ys).inverted()
 * 
 *     def flatpairs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a flat 1D array with x and y values interlaced
 */
  __pyx_tuple__245 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(0, 3175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__245);
  __Pyx_GIVEREF(__pyx_tuple__245);
  __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_flatpairs, 3175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) __PYX_ERR(0, 3175, __pyx_L1_error)

  /* "bpf4/core.pyx":3245
 *         return (xs, ys)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self._points()
 * 
 */
  __pyx_tuple__247 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(0, 3245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__247);
  __Pyx_GIVEREF(__pyx_tuple__247);
  __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 3245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(0, 3245, __pyx_L1_error)

  /* "bpf4/core.pyx":3248
 *         return self._points()
 * 
 *     def points(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple with the points defining this bpf
 */
  __pyx_tuple__249 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(0, 3248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);
  __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_points, 3248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(0, 3248, __pyx_L1_error)

  /* "bpf4/core.pyx":3269
 *         return self._points()
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */
  __pyx_tuple__251 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_num_segments, __pyx_n_s_exp, __pyx_n_s_interpoltype); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(0, 3269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);
  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_segments, 3269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 3269, __pyx_L1_error)

  /* "bpf4/core.pyx":3339
 *             return self.spline__call__(x)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if out is not None:
 *             out[...] = self.spline__call__(xs)
 */
  __pyx_tuple__252 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xs, __pyx_n_s_out); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(0, 3339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__252);
  __Pyx_GIVEREF(__pyx_tuple__252);
  __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__252, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_map, 3339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(0, 3339, __pyx_L1_error)

  /* "bpf4/core.pyx":3346
 *             return self.spline__call__(xs)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
  __pyx_tuple__254 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(0, 3346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__254);
  __Pyx_GIVEREF(__pyx_tuple__254);
  __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__254, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 3346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(0, 3346, __pyx_L1_error)

  /* "bpf4/core.pyx":3370
 *             return self.spline
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */
  __pyx_tuple__256 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_num_segments, __pyx_n_s_exp, __pyx_n_s_interpoltype); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(0, 3370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__256);
  __Pyx_GIVEREF(__pyx_tuple__256);
  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__256, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_segments, 3370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 3370, __pyx_L1_error)

  /* "bpf4/core.pyx":3398
 *         return self.b.__ccall__(x)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b, self.splitpoint
 * 
 */
  __pyx_tuple__257 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(0, 3398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__257);
  __Pyx_GIVEREF(__pyx_tuple__257);
  __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 3398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) __PYX_ERR(0, 3398, __pyx_L1_error)

  /* "bpf4/core.pyx":3401
 *         return self.a, self.b, self.splitpoint
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.a, self.b, self.splitpoint = state
 *         cdef double x0 = self.a._x0 if self.a._x0 < self.b._x0 else self.b._x0
 */
  __pyx_tuple__259 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_x0, __pyx_n_s_x1); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(0, 3401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__259);
  __Pyx_GIVEREF(__pyx_tuple__259);
  __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_setstate, 3401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(0, 3401, __pyx_L1_error)

  /* "bpf4/core.pyx":3446
 *         return self.offset + x*self.slope
 * 
 *     cpdef Slope _slice(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         return Slope(self.slope, self.offset, bounds=(x0, x1))
 * 
 */
  __pyx_tuple__261 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(0, 3446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__261);
  __Pyx_GIVEREF(__pyx_tuple__261);
  __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_slice, 3446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(0, 3446, __pyx_L1_error)

  /* "bpf4/core.pyx":3466
 *             return _create_rlambda(a, b, _BpfLambdaSub, _BpfLambdaSubConst, _BpfLambdaRSub, _BpfLambdaRSubConst)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
  __pyx_tuple__263 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(0, 3466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__263);
  __Pyx_GIVEREF(__pyx_tuple__263);
  __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 3466, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) __PYX_ERR(0, 3466, __pyx_L1_error)

  /* "bpf4/core.pyx":3508
 *         return BpfInterface.__mul__(a, b)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.slope, self.offset, self.bounds()
 * 
 */
  __pyx_tuple__265 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(0, 3508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__265);
  __Pyx_GIVEREF(__pyx_tuple__265);
  __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 3508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(0, 3508, __pyx_L1_error)

  /* "bpf4/core.pyx":3523
 *         return self.b.__ccall__(x)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b
 * 
 */
  __pyx_tuple__267 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(0, 3523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__267);
  __Pyx_GIVEREF(__pyx_tuple__267);
  __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 3523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(0, 3523, __pyx_L1_error)

  /* "bpf4/core.pyx":3526
 *         return self.a, self.b
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.a, self.b = state
 *         self._set_bounds(self.a._x0, self.a._x1)
 */
  __pyx_tuple__269 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_state); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(0, 3526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__269);
  __Pyx_GIVEREF(__pyx_tuple__269);
  __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_setstate, 3526, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(0, 3526, __pyx_L1_error)

  /* "bpf4/core.pyx":3530
 *         self._set_bounds(self.a._x0, self.a._x1)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
  __pyx_tuple__271 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(0, 3530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__271);
  __Pyx_GIVEREF(__pyx_tuple__271);
  __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 3530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(0, 3530, __pyx_L1_error)

  /* "bpf4/core.pyx":3637
 *             return self.last_bpf.__ccall__(x)
 * 
 *     cpdef BpfInterface concat(self, BpfInterface other, double fadetime=0, fadeshape='expon(3)'):             # <<<<<<<<<<<<<<
 *         cdef BpfInterface other2 = other.fit_between(self._x1, self._x1 + (other._x1 - other._x0))
 *         cdef int i
 */
  __pyx_tuple__273 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_fadetime, __pyx_n_s_fadeshape); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(0, 3637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__273);
  __Pyx_GIVEREF(__pyx_tuple__273);
  __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_concat, 3637, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(0, 3637, __pyx_L1_error)

  /* "bpf4/core.pyx":3649
 *         raise NotImplementedError("fade is not implemented")
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         cdef list xs
 *         cdef int i
 */
  __pyx_tuple__275 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_xs, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(0, 3649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__275);
  __Pyx_GIVEREF(__pyx_tuple__275);
  __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 3649, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) __PYX_ERR(0, 3649, __pyx_L1_error)

  /* "bpf4/core.pyx":3682
 *         return ya + yb
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b, self.which
 * 
 */
  __pyx_tuple__277 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(0, 3682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__277);
  __Pyx_GIVEREF(__pyx_tuple__277);
  __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 3682, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) __PYX_ERR(0, 3682, __pyx_L1_error)

  /* "bpf4/core.pyx":3707
 *         return self.a.__ccall__(x) * (1 - self.which) + self.b.__ccall__(x) * self.which
 * 
 *     def __getstate__(self): return self.a, self.b, self.which             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__279 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__279);
  __Pyx_GIVEREF(__pyx_tuple__279);
  __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 3707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) __PYX_ERR(0, 3707, __pyx_L1_error)

  /* "bpf4/core.pyx":3770
 *         free(self.interpolations)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         xs = [self.xs[i] for i in range(self.size)]
 */
  __pyx_tuple__281 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_xs, __pyx_n_s_ys, __pyx_n_s_interpolations, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(0, 3770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__281);
  __Pyx_GIVEREF(__pyx_tuple__281);
  __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 3770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) __PYX_ERR(0, 3770, __pyx_L1_error)

  /* "bpf4/core.pyx":3800
 *         return res
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */
  __pyx_tuple__283 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_func); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(0, 3800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__283);
  __Pyx_GIVEREF(__pyx_tuple__283);
  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_segments, 3800, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 3800, __pyx_L1_error)

  /* "bpf4/core.pyx":3820
 * 
 * 
 * def _FunctionWrap(f, bounds=(INFNEG, INF)):             # <<<<<<<<<<<<<<
 *     return _FunctionWrap_Object(f, bounds)
 * 
 */
  __pyx_tuple__284 = PyTuple_Pack(2, __pyx_n_s_f, __pyx_n_s_bounds); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(0, 3820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__284);
  __Pyx_GIVEREF(__pyx_tuple__284);
  __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__284, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_FunctionWrap, 3820, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) __PYX_ERR(0, 3820, __pyx_L1_error)
  __pyx_tuple__286 = PyTuple_Pack(1, ((PyObject*)__pyx_tuple__5)); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(0, 3820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__286);
  __Pyx_GIVEREF(__pyx_tuple__286);

  /* "bpf4/core.pyx":3840
 *             return self.f(x)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.f, (self._x0, self._x1))
 * 
 */
  __pyx_tuple__287 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(0, 3840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__287);
  __Pyx_GIVEREF(__pyx_tuple__287);
  __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 3840, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) __PYX_ERR(0, 3840, __pyx_L1_error)

  /* "bpf4/core.pyx":3843
 *         return (self.f, (self._x0, self._x1))
 * 
 *     cpdef BpfInterface _slice(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         return _FunctionWrap_Object_OutboundConst_new(self, x0, x1)
 * 
 */
  __pyx_tuple__289 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__289);
  __Pyx_GIVEREF(__pyx_tuple__289);
  __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_slice, 3843, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) __PYX_ERR(0, 3843, __pyx_L1_error)

  /* "bpf4/core.pyx":3846
 *         return _FunctionWrap_Object_OutboundConst_new(self, x0, x1)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
  __pyx_tuple__291 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xs, __pyx_n_s_out); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(0, 3846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__291);
  __Pyx_GIVEREF(__pyx_tuple__291);
  __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_map, 3846, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(0, 3846, __pyx_L1_error)

  /* "bpf4/core.pyx":3904
 *         return result
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         xs = numpy.linspace(x0, x1, n)
 *         return self.map(xs, out=out)
 */
  __pyx_tuple__293 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(0, 3904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__293);
  __Pyx_GIVEREF(__pyx_tuple__293);
  __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 3904, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) __PYX_ERR(0, 3904, __pyx_L1_error)

  /* "bpf4/core.pyx":3951
 *         return self.value
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.value,)
 * 
 */
  __pyx_tuple__295 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(0, 3951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__295);
  __Pyx_GIVEREF(__pyx_tuple__295);
  __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 3951, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) __PYX_ERR(0, 3951, __pyx_L1_error)

  /* "bpf4/core.pyx":3954
 *         return (self.value,)
 * 
 *     def _get_points_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         x0 = self._x0 if self._x0 > INFNEG else 0.
 *         x1 = self._x1 if self._x1 < INF else 1.
 */
  __pyx_tuple__297 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(0, 3954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__297);
  __Pyx_GIVEREF(__pyx_tuple__297);
  __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_get_points_for_rendering, 3954, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(0, 3954, __pyx_L1_error)

  /* "bpf4/core.pyx":3968
 *         return out
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if out is not None:
 *             out[...] = self.value
 */
  __pyx_tuple__299 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(0, 3968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__299);
  __Pyx_GIVEREF(__pyx_tuple__299);
  __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 3968, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(0, 3968, __pyx_L1_error)

  /* "bpf4/core.pyx":4030
 *         self._x0, self._x1 = bounds
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b, (self._x0, self._x1)
 * 
 */
  __pyx_tuple__301 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(0, 4030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__301);
  __Pyx_GIVEREF(__pyx_tuple__301);
  __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 4030, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) __PYX_ERR(0, 4030, __pyx_L1_error)

  /* "bpf4/core.pyx":4033
 *         return self.a, self.b, (self._x0, self._x1)
 * 
 *     def _get_xs_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         return numpy.unique(numpy.append(self.a._get_xs_for_rendering(n), self.b._get_xs_for_rendering(n)))
 * 
 */
  __pyx_tuple__303 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_n); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(0, 4033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__303);
  __Pyx_GIVEREF(__pyx_tuple__303);
  __pyx_codeobj__304 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__303, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_get_xs_for_rendering, 4033, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__304)) __PYX_ERR(0, 4033, __pyx_L1_error)

  /* "bpf4/core.pyx":4046
 *         pass
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = <ndarray>out if out is not None else EMPTY1D(n)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(n)
 */
  __pyx_tuple__305 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(0, 4046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__305);
  __Pyx_GIVEREF(__pyx_tuple__305);
  __pyx_codeobj__306 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 4046, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) __PYX_ERR(0, 4046, __pyx_L1_error)

  /* "bpf4/core.pyx":4058
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
  __pyx_tuple__307 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xs, __pyx_n_s_out); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(0, 4058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__307);
  __Pyx_GIVEREF(__pyx_tuple__307);
  __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_map, 4058, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) __PYX_ERR(0, 4058, __pyx_L1_error)

  /* "bpf4/core.pyx":4086
 *     cdef int funcindex
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), (), self.a, self.funcindex
 * 
 */
  __pyx_tuple__309 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(0, 4086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__309);
  __Pyx_GIVEREF(__pyx_tuple__309);
  __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_reduce, 4086, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) __PYX_ERR(0, 4086, __pyx_L1_error)

  /* "bpf4/core.pyx":4089
 *         return type(self), (), self.a, self.funcindex
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         bpf, funcindex = state
 *         return _BpfUnaryFunc_new_from_index(bpf, funcindex)
 */
  __pyx_tuple__311 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_bpf, __pyx_n_s_funcindex); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(0, 4089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__311);
  __Pyx_GIVEREF(__pyx_tuple__311);
  __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_setstate, 4089, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) __PYX_ERR(0, 4089, __pyx_L1_error)

  /* "bpf4/core.pyx":4101
 *         return self.func(self.a.__ccall__(x))
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         cdef t_unfunc func = self.func
 */
  __pyx_tuple__313 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(0, 4101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__313);
  __Pyx_GIVEREF(__pyx_tuple__313);
  __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 4101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) __PYX_ERR(0, 4101, __pyx_L1_error)

  /* "bpf4/core.pyx":4108
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
  __pyx_tuple__315 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xs, __pyx_n_s_out); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(0, 4108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__315);
  __Pyx_GIVEREF(__pyx_tuple__315);
  __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_map, 4108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) __PYX_ERR(0, 4108, __pyx_L1_error)

  /* "bpf4/core.pyx":4163
 *         return X
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.a,)
 * 
 */
  __pyx_tuple__317 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(0, 4163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__317);
  __Pyx_GIVEREF(__pyx_tuple__317);
  __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 4163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) __PYX_ERR(0, 4163, __pyx_L1_error)

  /* "bpf4/core.pyx":4166
 *         return (self.a,)
 * 
 *     def _get_xs_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         return self.a._get_xs_for_rendering(n)
 * 
 */
  __pyx_tuple__319 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_n); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(0, 4166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__319);
  __Pyx_GIVEREF(__pyx_tuple__319);
  __pyx_codeobj__320 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__319, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_get_xs_for_rendering, 4166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__320)) __PYX_ERR(0, 4166, __pyx_L1_error)

  /* "bpf4/core.pyx":4172
 *         pass
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         with nogil:
 */
  __pyx_tuple__321 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(0, 4172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__321);
  __Pyx_GIVEREF(__pyx_tuple__321);
  __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 4172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) __PYX_ERR(0, 4172, __pyx_L1_error)

  /* "bpf4/core.pyx":4178
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
  __pyx_tuple__323 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xs, __pyx_n_s_out); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(0, 4178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__323);
  __Pyx_GIVEREF(__pyx_tuple__323);
  __pyx_codeobj__324 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__323, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_map, 4178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__324)) __PYX_ERR(0, 4178, __pyx_L1_error)

  /* "bpf4/core.pyx":4208
 *         self._x0, self._x1 = bounds
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b_const, (self._x0, self._x1)
 * 
 */
  __pyx_tuple__325 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(0, 4208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__325);
  __Pyx_GIVEREF(__pyx_tuple__325);
  __pyx_codeobj__326 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__325, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 4208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__326)) __PYX_ERR(0, 4208, __pyx_L1_error)

  /* "bpf4/core.pyx":4211
 *         return self.a, self.b_const, (self._x0, self._x1)
 * 
 *     def _get_xs_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         return self.a._get_xs_for_rendering(n)
 * 
 */
  __pyx_tuple__327 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_n); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(0, 4211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__327);
  __Pyx_GIVEREF(__pyx_tuple__327);
  __pyx_codeobj__328 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__327, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_get_xs_for_rendering, 4211, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__328)) __PYX_ERR(0, 4211, __pyx_L1_error)

  /* "bpf4/core.pyx":4217
 *         pass
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
  __pyx_tuple__329 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xs, __pyx_n_s_out); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(0, 4217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__329);
  __Pyx_GIVEREF(__pyx_tuple__329);
  __pyx_codeobj__330 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__329, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_map, 4217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__330)) __PYX_ERR(0, 4217, __pyx_L1_error)

  /* "bpf4/core.pyx":4260
 *             A[i] += B[i]
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) + self.b.integrate_between(x0, x1, N)
 * 
 */
  __pyx_tuple__331 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(0, 4260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__331);
  __Pyx_GIVEREF(__pyx_tuple__331);
  __pyx_codeobj__332 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__331, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate_between, 4260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__332)) __PYX_ERR(0, 4260, __pyx_L1_error)

  /* "bpf4/core.pyx":4284
 *                 return _BpfBinOpConst.__add__(b, a)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) + (x1 - x0) * self.b_const
 * 
 */
  __pyx_tuple__333 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(0, 4284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__333);
  __Pyx_GIVEREF(__pyx_tuple__333);
  __pyx_codeobj__334 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__333, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate_between, 4284, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__334)) __PYX_ERR(0, 4284, __pyx_L1_error)

  /* "bpf4/core.pyx":4292
 *         for i in range(n):
 *             A[i] -= B[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) - self.b.integrate_between(x0, x1, N)
 * 
 */
  __pyx_tuple__335 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(0, 4292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__335);
  __Pyx_GIVEREF(__pyx_tuple__335);
  __pyx_codeobj__336 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__335, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate_between, 4292, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__336)) __PYX_ERR(0, 4292, __pyx_L1_error)

  /* "bpf4/core.pyx":4300
 *         for i in range(n):
 *             B[i] -= A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.b.integrate_between(x0, x1, N) - self.a.integrate_between(x0, x1, N)
 * 
 */
  __pyx_tuple__337 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(0, 4300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__337);
  __Pyx_GIVEREF(__pyx_tuple__337);
  __pyx_codeobj__338 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__337, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate_between, 4300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__338)) __PYX_ERR(0, 4300, __pyx_L1_error)

  /* "bpf4/core.pyx":4308
 *         for i in range(n):
 *             A[i] -= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) - (x1-x0)*self.b_const
 * 
 */
  __pyx_tuple__339 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__339)) __PYX_ERR(0, 4308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__339);
  __Pyx_GIVEREF(__pyx_tuple__339);
  __pyx_codeobj__340 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__339, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate_between, 4308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__340)) __PYX_ERR(0, 4308, __pyx_L1_error)

  /* "bpf4/core.pyx":4316
 *         for i in range(n):
 *             A[i] = b - A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.b_const*(x1-x0) - self.a.integrate_between(x0, x1, N)
 * 
 */
  __pyx_tuple__341 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(0, 4316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__341);
  __Pyx_GIVEREF(__pyx_tuple__341);
  __pyx_codeobj__342 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__341, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate_between, 4316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__342)) __PYX_ERR(0, 4316, __pyx_L1_error)

  /* "bpf4/core.pyx":4330
 *         for i in range(n):
 *             A[i] *= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) * self.b_const
 * 
 */
  __pyx_tuple__343 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__343)) __PYX_ERR(0, 4330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__343);
  __Pyx_GIVEREF(__pyx_tuple__343);
  __pyx_codeobj__344 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__343, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate_between, 4330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__344)) __PYX_ERR(0, 4330, __pyx_L1_error)

  /* "bpf4/core.pyx":4542
 *             return self.y0
 *         return y
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ndarray [DTYPE_t, ndim=1] result
 */
  __pyx_tuple__345 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__345)) __PYX_ERR(0, 4542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__345);
  __Pyx_GIVEREF(__pyx_tuple__345);
  __pyx_codeobj__346 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__345, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 4542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__346)) __PYX_ERR(0, 4542, __pyx_L1_error)

  /* "bpf4/core.pyx":4578
 *             return out
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), (), (self.bpf, self.y0, self.y1)
 * 
 */
  __pyx_tuple__347 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(0, 4578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__347);
  __Pyx_GIVEREF(__pyx_tuple__347);
  __pyx_codeobj__348 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__347, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_reduce, 4578, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__348)) __PYX_ERR(0, 4578, __pyx_L1_error)

  /* "bpf4/core.pyx":4581
 *         return type(self), (), (self.bpf, self.y0, self.y1)
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.bpf, self.y0, self.y1 = state
 *         self._set_bounds_like(self.bpf)
 */
  __pyx_tuple__349 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_state); if (unlikely(!__pyx_tuple__349)) __PYX_ERR(0, 4581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__349);
  __Pyx_GIVEREF(__pyx_tuple__349);
  __pyx_codeobj__350 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__349, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_setstate, 4581, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__350)) __PYX_ERR(0, 4581, __pyx_L1_error)

  /* "bpf4/core.pyx":4630
 *         return (f1 - f0) / h
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.bpf,)
 * 
 */
  __pyx_tuple__351 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(0, 4630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__351);
  __Pyx_GIVEREF(__pyx_tuple__351);
  __pyx_codeobj__352 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__351, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 4630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__352)) __PYX_ERR(0, 4630, __pyx_L1_error)

  /* "bpf4/core.pyx":4660
 *         return out
 * 
 *     def __getstate__(self): return (self.bpf,)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__353 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(0, 4660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__353);
  __Pyx_GIVEREF(__pyx_tuple__353);
  __pyx_codeobj__354 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__353, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 4660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__354)) __PYX_ERR(0, 4660, __pyx_L1_error)

  /* "bpf4/core.pyx":4716
 * 
 *     @cython.cdivision(True)
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef double [::1] accums
 *         cdef double dx0, dx1, dy
 */
  __pyx_tuple__355 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(0, 4716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__355);
  __Pyx_GIVEREF(__pyx_tuple__355);
  __pyx_codeobj__356 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__355, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 4716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__356)) __PYX_ERR(0, 4716, __pyx_L1_error)

  /* "bpf4/core.pyx":4741
 *             return numpy.asarray(accums)
 * 
 *     cpdef BpfInterface derivative(self):             # <<<<<<<<<<<<<<
 *         return self.bpf
 * 
 */
  __pyx_tuple__357 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(0, 4741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__357);
  __Pyx_GIVEREF(__pyx_tuple__357);
  __pyx_codeobj__358 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__357, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_derivative, 4741, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__358)) __PYX_ERR(0, 4741, __pyx_L1_error)

  /* "bpf4/core.pyx":4744
 *         return self.bpf
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.bpf, self.N, self.bounds(), self.min_N_ratio, self.Nexp)
 * 
 */
  __pyx_tuple__359 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(0, 4744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__359);
  __Pyx_GIVEREF(__pyx_tuple__359);
  __pyx_codeobj__360 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__359, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 4744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__360)) __PYX_ERR(0, 4744, __pyx_L1_error)

  /* "bpf4/core.pyx":4769
 *         return self.bpf.__ccall__( p )
 * 
 *     def __getstate__(self): return (self.bpf,)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__361 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(0, 4769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__361);
  __Pyx_GIVEREF(__pyx_tuple__361);
  __pyx_codeobj__362 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__361, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 4769, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__362)) __PYX_ERR(0, 4769, __pyx_L1_error)

  /* "bpf4/core.pyx":4807
 *         return self.bpf.__ccall__(x)
 * 
 *     def fixpoint(self):             # <<<<<<<<<<<<<<
 *         return 1 - (self.fx - self.offset*self.rx)/self.rx
 * 
 */
  __pyx_tuple__363 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__363)) __PYX_ERR(0, 4807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__363);
  __Pyx_GIVEREF(__pyx_tuple__363);
  __pyx_codeobj__364 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__363, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_fixpoint, 4807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__364)) __PYX_ERR(0, 4807, __pyx_L1_error)

  /* "bpf4/core.pyx":4810
 *         return 1 - (self.fx - self.offset*self.rx)/self.rx
 * 
 *     def __getstate__(self): return (self.bpf, self.rx, self.dx, self.bounds())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__365 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__365);
  __Pyx_GIVEREF(__pyx_tuple__365);
  __pyx_codeobj__366 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 4810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__366)) __PYX_ERR(0, 4810, __pyx_L1_error)

  /* "bpf4/core.pyx":4854
 *             return self.bpf.__ccall__(x0) + slope * (x - x0)
 * 
 *     def __getstate__(self): return self.bpf, self.EPSILON             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__367 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(0, 4854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__367);
  __Pyx_GIVEREF(__pyx_tuple__367);
  __pyx_codeobj__368 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__367, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 4854, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__368)) __PYX_ERR(0, 4854, __pyx_L1_error)

  /* "bpf4/core.pyx":4872
 *             return self.bpf.__ccall__(x)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), (), (self.bpf, self._x0, self._x1, self.outbound_mode, self._y0, self._y1)
 * 
 */
  __pyx_tuple__369 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(0, 4872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__369);
  __Pyx_GIVEREF(__pyx_tuple__369);
  __pyx_codeobj__370 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__369, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_reduce, 4872, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__370)) __PYX_ERR(0, 4872, __pyx_L1_error)

  /* "bpf4/core.pyx":4875
 *         return type(self), (), (self.bpf, self._x0, self._x1, self.outbound_mode, self._y0, self._y1)
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.bpf, x0, x1, self.outbound_mode, self._y0, self._y1 = state
 *         self._set_bounds(x0, x1)
 */
  __pyx_tuple__371 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_x0, __pyx_n_s_x1); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(0, 4875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__371);
  __Pyx_GIVEREF(__pyx_tuple__371);
  __pyx_codeobj__372 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__371, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_setstate, 4875, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__372)) __PYX_ERR(0, 4875, __pyx_L1_error)

  /* "bpf4/core.pyx":4879
 *         self._set_bounds(x0, x1)
 * 
 *     cpdef _BpfCrop outbound_set(self, double y0, double y1):             # <<<<<<<<<<<<<<
 *         """
 *         set the value returned by this BPF outside its defined bounds (inplace)
 */
  __pyx_tuple__373 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_y0, __pyx_n_s_y1); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(0, 4879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__373);
  __Pyx_GIVEREF(__pyx_tuple__373);
  __pyx_codeobj__374 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__373, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_outbound_set, 4879, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__374)) __PYX_ERR(0, 4879, __pyx_L1_error)

  /* "bpf4/core.pyx":4888
 *         return self
 * 
 *     def outbound(self, double y0, y1=None):             # <<<<<<<<<<<<<<
 *         """
 *         return a new Bpf with the given values outside the bounds
 */
  __pyx_tuple__375 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_y0, __pyx_n_s_y1); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(0, 4888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__375);
  __Pyx_GIVEREF(__pyx_tuple__375);
  __pyx_codeobj__376 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__375, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_outbound, 4888, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__376)) __PYX_ERR(0, 4888, __pyx_L1_error)

  /* "bpf4/core.pyx":4901
 *         return _BpfCrop_new(self.bpf, self._x0, self._x1, OUTBOUND_SET, y0, y1)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         if x0 >= self.bpf._x0 and x1 <= self.bpf._x1:
 *             return self.bpf.integrate_between(x0, x1)
 */
  __pyx_tuple__377 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__377)) __PYX_ERR(0, 4901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__377);
  __Pyx_GIVEREF(__pyx_tuple__377);
  __pyx_codeobj__378 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__377, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_integrate_between, 4901, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__378)) __PYX_ERR(0, 4901, __pyx_L1_error)

  /* "bpf4/core.pyx":4918
 *         return integr0 + integr1 + integr2
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if self.outbound_mode == OUTBOUND_DONOTHING:
 *             return self.bpf.mapn_between(n, x0, x1, out)
 */
  __pyx_tuple__379 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_out); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(0, 4918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__379);
  __Pyx_GIVEREF(__pyx_tuple__379);
  __pyx_codeobj__380 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__379, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_mapn_between, 4918, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__380)) __PYX_ERR(0, 4918, __pyx_L1_error)

  /* "bpf4/core.pyx":4965
 * 
 * 
 * cpdef _BpfCrop _BpfCrop_new(BpfInterface bpf, double x0, double x1, int outbound_mode,             # <<<<<<<<<<<<<<
 *                             double outbound0=0, double outbound1=0):
 *     """
 */
  __pyx_tuple__381 = PyTuple_Pack(6, __pyx_n_s_bpf, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_outbound_mode, __pyx_n_s_outbound0, __pyx_n_s_outbound1); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(0, 4965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__381);
  __Pyx_GIVEREF(__pyx_tuple__381);
  __pyx_codeobj__382 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__381, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_BpfCrop_new, 4965, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__382)) __PYX_ERR(0, 4965, __pyx_L1_error)

  /* "bpf4/core.pyx":5012
 *         free(self.bpfpointers)
 * 
 *     def _calculate_bounds(self):             # <<<<<<<<<<<<<<
 *         cdef double bounds0, bounds1
 *         cdef double x0=INF, x1=INFNEG
 */
  __pyx_tuple__383 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_bounds0, __pyx_n_s_bounds1, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_bpf, __pyx_n_s_bound0, __pyx_n_s_bound1); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(0, 5012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__383);
  __Pyx_GIVEREF(__pyx_tuple__383);
  __pyx_codeobj__384 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_calculate_bounds, 5012, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__384)) __PYX_ERR(0, 5012, __pyx_L1_error)

  /* "bpf4/core.pyx":5023
 *         self._set_bounds(x0, x1)
 * 
 *     def __getstate__(self): return (self._bpfs,)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __pyx_tuple__385 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(0, 5023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__385);
  __Pyx_GIVEREF(__pyx_tuple__385);
  __pyx_codeobj__386 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_getstate, 5023, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__386)) __PYX_ERR(0, 5023, __pyx_L1_error)

  /* "bpf4/core.pyx":5140
 *             return InterpolFunc_call(self.func, index, x0, y0, x0+1, y1)
 * 
 * def brentq(bpf, double x0, double xa, double xb, double xtol=9.9999999999999998e-13,             # <<<<<<<<<<<<<<
 *            double rtol=4.4408920985006262e-16, max_iter=100):
 *     """
 */
  __pyx_tuple__387 = PyTuple_Pack(10, __pyx_n_s_bpf, __pyx_n_s_x0, __pyx_n_s_xa, __pyx_n_s_xb, __pyx_n_s_xtol, __pyx_n_s_rtol, __pyx_n_s_max_iter, __pyx_n_s_outerror, __pyx_n_s_funcalls, __pyx_n_s_result); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(0, 5140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__387);
  __Pyx_GIVEREF(__pyx_tuple__387);
  __pyx_codeobj__388 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_brentq, 5140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__388)) __PYX_ERR(0, 5140, __pyx_L1_error)

  /* "bpf4/core.pyx":5182
 * 
 * 
 * cpdef BpfInterface blend(a, b, mix=0.5):             # <<<<<<<<<<<<<<
 *     """
 *     Blend these BPFs
 */
  __pyx_tuple__389 = PyTuple_Pack(3, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_mix); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(0, 5182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__389);
  __Pyx_GIVEREF(__pyx_tuple__389);
  __pyx_codeobj__390 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__389, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_blend, 5182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__390)) __PYX_ERR(0, 5182, __pyx_L1_error)

  /* "bpf4/core.pyx":5316
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cpdef list bpf_zero_crossings(BpfInterface b, double h=0.01, int N=0,             # <<<<<<<<<<<<<<
 *                               double x0=NAN, double x1=NAN, int maxzeros=0):
 *     """
 */
  __pyx_tuple__391 = PyTuple_Pack(6, __pyx_n_s_b, __pyx_n_s_h, __pyx_n_s_N, __pyx_n_s_x0, __pyx_n_s_x1, __pyx_n_s_maxzeros); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(0, 5316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__391);
  __Pyx_GIVEREF(__pyx_tuple__391);
  __pyx_codeobj__392 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_bpf4_core_pyx, __pyx_n_s_bpf_zero_crossings, 5316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__392)) __PYX_ERR(0, 5316, __pyx_L1_error)

  /* "View.MemoryView":286
 *         return self.name
 * 
 * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")
 */
  __pyx_tuple__393 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(2, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__393);
  __Pyx_GIVEREF(__pyx_tuple__393);

  /* "View.MemoryView":287
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
 */
  __pyx_tuple__394 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__394)) __PYX_ERR(2, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__394);
  __Pyx_GIVEREF(__pyx_tuple__394);

  /* "View.MemoryView":288
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__395 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(2, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__395);
  __Pyx_GIVEREF(__pyx_tuple__395);

  /* "View.MemoryView":291
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
 */
  __pyx_tuple__396 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__396)) __PYX_ERR(2, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__396);
  __Pyx_GIVEREF(__pyx_tuple__396);

  /* "View.MemoryView":292
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__397 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(2, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__397);
  __Pyx_GIVEREF(__pyx_tuple__397);

  /* "(tree fragment)":1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__398 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__398)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__398);
  __Pyx_GIVEREF(__pyx_tuple__398);
  __pyx_codeobj__399 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__398, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__399)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_float_0_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_inf = PyFloat_FromDouble(Py_HUGE_VAL); if (unlikely(!__pyx_float_inf)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_neg_inf = PyFloat_FromDouble((-Py_HUGE_VAL)); if (unlikely(!__pyx_float_neg_inf)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_200 = PyInt_FromLong(200); if (unlikely(!__pyx_int_200)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_99999 = PyInt_FromLong(99999L); if (unlikely(!__pyx_int_99999)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_2 = PyInt_FromLong(-2); if (unlikely(!__pyx_int_neg_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  generic = Py_None; Py_INCREF(Py_None);
  strided = Py_None; Py_INCREF(Py_None);
  indirect = Py_None; Py_INCREF(Py_None);
  contiguous = Py_None; Py_INCREF(Py_None);
  indirect_contiguous = Py_None; Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_4bpf4_4core_BpfInterface = &__pyx_vtable_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core_BpfInterface._asbpf = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface__asbpf;
  __pyx_vtable_4bpf4_4core_BpfInterface._bounds_changed = (void (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *))__pyx_f_4bpf4_4core_12BpfInterface__bounds_changed;
  __pyx_vtable_4bpf4_4core_BpfInterface._set_bounds = (void (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double))__pyx_f_4bpf4_4core_12BpfInterface__set_bounds;
  __pyx_vtable_4bpf4_4core_BpfInterface._set_bounds_like = (void (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, struct __pyx_obj_4bpf4_4core_BpfInterface *))__pyx_f_4bpf4_4core_12BpfInterface__set_bounds_like;
  __pyx_vtable_4bpf4_4core_BpfInterface.ntodx = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_ntodx;
  __pyx_vtable_4bpf4_4core_BpfInterface.dxton = (int (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_dxton;
  __pyx_vtable_4bpf4_4core_BpfInterface.sampled = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled *__pyx_optional_args))__pyx_f_4bpf4_4core_12BpfInterface_sampled;
  __pyx_vtable_4bpf4_4core_BpfInterface.sample_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sample_between *__pyx_optional_args))__pyx_f_4bpf4_4core_12BpfInterface_sample_between;
  __pyx_vtable_4bpf4_4core_BpfInterface.sampled_between = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_sampled_between *__pyx_optional_args))__pyx_f_4bpf4_4core_12BpfInterface_sampled_between;
  __pyx_vtable_4bpf4_4core_BpfInterface.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_12BpfInterface_mapn_between;
  __pyx_vtable_4bpf4_4core_BpfInterface.map = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map *__pyx_optional_args))__pyx_f_4bpf4_4core_12BpfInterface_map;
  __pyx_vtable_4bpf4_4core_BpfInterface.concat = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_concat;
  __pyx_vtable_4bpf4_4core_BpfInterface.round = (struct __pyx_obj_4bpf4_4core__BpfLambdaRound *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_round;
  __pyx_vtable_4bpf4_4core_BpfInterface.rand = (struct __pyx_obj_4bpf4_4core__BpfRand *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_rand;
  __pyx_vtable_4bpf4_4core_BpfInterface.cos = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_cos;
  __pyx_vtable_4bpf4_4core_BpfInterface.sin = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_sin;
  __pyx_vtable_4bpf4_4core_BpfInterface.ceil = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_ceil;
  __pyx_vtable_4bpf4_4core_BpfInterface.expon = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_expon;
  __pyx_vtable_4bpf4_4core_BpfInterface.floor = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_floor;
  __pyx_vtable_4bpf4_4core_BpfInterface.tanh = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_tanh;
  __pyx_vtable_4bpf4_4core_BpfInterface.abs = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_abs;
  __pyx_vtable_4bpf4_4core_BpfInterface.sqrt = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_sqrt;
  __pyx_vtable_4bpf4_4core_BpfInterface.acos = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_acos;
  __pyx_vtable_4bpf4_4core_BpfInterface.asin = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_asin;
  __pyx_vtable_4bpf4_4core_BpfInterface.tan = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_tan;
  __pyx_vtable_4bpf4_4core_BpfInterface.sinh = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_sinh;
  __pyx_vtable_4bpf4_4core_BpfInterface.log10 = (struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_log10;
  __pyx_vtable_4bpf4_4core_BpfInterface.log = (struct __pyx_obj_4bpf4_4core__BpfLambdaLog *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_log *__pyx_optional_args))__pyx_f_4bpf4_4core_12BpfInterface_log;
  __pyx_vtable_4bpf4_4core_BpfInterface.m2f = (struct __pyx_obj_4bpf4_4core__BpfM2F *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_m2f;
  __pyx_vtable_4bpf4_4core_BpfInterface.f2m = (struct __pyx_obj_4bpf4_4core__BpfF2M *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_f2m;
  __pyx_vtable_4bpf4_4core_BpfInterface.db2amp = (struct __pyx_obj_4bpf4_4core__Bpf_db2amp *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_db2amp;
  __pyx_vtable_4bpf4_4core_BpfInterface.amp2db = (struct __pyx_obj_4bpf4_4core__Bpf_amp2db *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_amp2db;
  __pyx_vtable_4bpf4_4core_BpfInterface.clip = (struct __pyx_obj_4bpf4_4core__BpfLambdaClip *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_clip *__pyx_optional_args))__pyx_f_4bpf4_4core_12BpfInterface_clip;
  __pyx_vtable_4bpf4_4core_BpfInterface.derivative = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_derivative;
  __pyx_vtable_4bpf4_4core_BpfInterface.integrated = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_integrated;
  __pyx_vtable_4bpf4_4core_BpfInterface.integrate = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_integrate;
  __pyx_vtable_4bpf4_4core_BpfInterface.trapz_integrate_between = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_trapz_integrate_between *__pyx_optional_args))__pyx_f_4bpf4_4core_12BpfInterface_trapz_integrate_between;
  __pyx_vtable_4bpf4_4core_BpfInterface.integrate_between = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args))__pyx_f_4bpf4_4core_12BpfInterface_integrate_between;
  __pyx_vtable_4bpf4_4core_BpfInterface.mean = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_mean;
  __pyx_vtable_4bpf4_4core_BpfInterface.zeros = (PyObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_zeros *__pyx_optional_args))__pyx_f_4bpf4_4core_12BpfInterface_zeros;
  __pyx_vtable_4bpf4_4core_BpfInterface.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_12BpfInterface___ccall__;
  __pyx_vtable_4bpf4_4core_BpfInterface.fit_between = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_fit_between;
  __pyx_vtable_4bpf4_4core_BpfInterface.shifted = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface_shifted;
  __pyx_vtable_4bpf4_4core_BpfInterface._slice = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_12BpfInterface__slice;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_BpfInterface) < 0) __PYX_ERR(0, 656, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_BpfInterface.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_BpfInterface.tp_dictoffset && __pyx_type_4bpf4_4core_BpfInterface.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_BpfInterface.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_BpfInterface, "__or__"); if (unlikely(!wrapper)) __PYX_ERR(0, 656, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_12BpfInterface_26__or__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_12BpfInterface_26__or__.doc = __pyx_doc_4bpf4_4core_12BpfInterface_26__or__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_12BpfInterface_26__or__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_BpfInterface, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 656, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_12BpfInterface_116__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_12BpfInterface_116__call__.doc = __pyx_doc_4bpf4_4core_12BpfInterface_116__call__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_12BpfInterface_116__call__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_BpfInterface.tp_dict, __pyx_vtabptr_4bpf4_4core_BpfInterface) < 0) __PYX_ERR(0, 656, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfInterface, (PyObject *)&__pyx_type_4bpf4_4core_BpfInterface) < 0) __PYX_ERR(0, 656, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_BpfInterface = &__pyx_type_4bpf4_4core_BpfInterface;
  __pyx_vtabptr_4bpf4_4core_BpfBase = &__pyx_vtable_4bpf4_4core_BpfBase;
  __pyx_vtable_4bpf4_4core_BpfBase.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core_BpfBase.__pyx_base._bounds_changed = (void (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *))__pyx_f_4bpf4_4core_7BpfBase__bounds_changed;
  __pyx_vtable_4bpf4_4core_BpfBase.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_7BpfBase_mapn_between;
  __pyx_vtable_4bpf4_4core_BpfBase.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_7BpfBase___ccall__;
  __pyx_vtable_4bpf4_4core_BpfBase._invalidate_cache = (void (*)(struct __pyx_obj_4bpf4_4core_BpfBase *))__pyx_f_4bpf4_4core_7BpfBase__invalidate_cache;
  __pyx_vtable_4bpf4_4core_BpfBase._mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfBase *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_7BpfBase__mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_7BpfBase__mapn_between;
  __pyx_vtable_4bpf4_4core_BpfBase._recalculate_bounds = (void (*)(struct __pyx_obj_4bpf4_4core_BpfBase *))__pyx_f_4bpf4_4core_7BpfBase__recalculate_bounds;
  __pyx_type_4bpf4_4core_BpfBase.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_BpfBase) < 0) __PYX_ERR(0, 2010, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_BpfBase.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_BpfBase.tp_dictoffset && __pyx_type_4bpf4_4core_BpfBase.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_BpfBase.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_BpfBase, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 2010, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_7BpfBase_4__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_7BpfBase_4__init__.doc = __pyx_doc_4bpf4_4core_7BpfBase_4__init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_7BpfBase_4__init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_BpfBase.tp_dict, __pyx_vtabptr_4bpf4_4core_BpfBase) < 0) __PYX_ERR(0, 2010, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfBase, (PyObject *)&__pyx_type_4bpf4_4core_BpfBase) < 0) __PYX_ERR(0, 2010, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_BpfBase = &__pyx_type_4bpf4_4core_BpfBase;
  __pyx_vtabptr_4bpf4_4core_Linear = &__pyx_vtable_4bpf4_4core_Linear;
  __pyx_vtable_4bpf4_4core_Linear.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfBase;
  __pyx_vtable_4bpf4_4core_Linear.__pyx_base.__pyx_base.integrate_between = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args))__pyx_f_4bpf4_4core_6Linear_integrate_between;
  __pyx_vtable_4bpf4_4core_Linear.sliced = (struct __pyx_obj_4bpf4_4core_Linear *(*)(struct __pyx_obj_4bpf4_4core_Linear *, double, double, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_6Linear_sliced;
  __pyx_type_4bpf4_4core_Linear.tp_base = __pyx_ptype_4bpf4_4core_BpfBase;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Linear) < 0) __PYX_ERR(0, 2361, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Linear.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Linear.tp_dictoffset && __pyx_type_4bpf4_4core_Linear.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Linear.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_Linear, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 2361, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_6Linear___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_6Linear___init__.doc = __pyx_doc_4bpf4_4core_6Linear___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_6Linear___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Linear.tp_dict, __pyx_vtabptr_4bpf4_4core_Linear) < 0) __PYX_ERR(0, 2361, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Linear, (PyObject *)&__pyx_type_4bpf4_4core_Linear) < 0) __PYX_ERR(0, 2361, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Linear = &__pyx_type_4bpf4_4core_Linear;
  __pyx_vtabptr_4bpf4_4core_Smooth = &__pyx_vtable_4bpf4_4core_Smooth;
  __pyx_vtable_4bpf4_4core_Smooth.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfBase;
  __pyx_type_4bpf4_4core_Smooth.tp_base = __pyx_ptype_4bpf4_4core_BpfBase;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Smooth) < 0) __PYX_ERR(0, 2474, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Smooth.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Smooth.tp_dictoffset && __pyx_type_4bpf4_4core_Smooth.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Smooth.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_Smooth, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 2474, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_6Smooth___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_6Smooth___init__.doc = __pyx_doc_4bpf4_4core_6Smooth___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_6Smooth___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Smooth.tp_dict, __pyx_vtabptr_4bpf4_4core_Smooth) < 0) __PYX_ERR(0, 2474, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Smooth, (PyObject *)&__pyx_type_4bpf4_4core_Smooth) < 0) __PYX_ERR(0, 2474, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Smooth = &__pyx_type_4bpf4_4core_Smooth;
  __pyx_vtabptr_4bpf4_4core_Smoother = &__pyx_vtable_4bpf4_4core_Smoother;
  __pyx_vtable_4bpf4_4core_Smoother.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfBase;
  __pyx_type_4bpf4_4core_Smoother.tp_base = __pyx_ptype_4bpf4_4core_BpfBase;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Smoother) < 0) __PYX_ERR(0, 2509, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Smoother.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Smoother.tp_dictoffset && __pyx_type_4bpf4_4core_Smoother.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Smoother.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Smoother.tp_dict, __pyx_vtabptr_4bpf4_4core_Smoother) < 0) __PYX_ERR(0, 2509, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Smoother, (PyObject *)&__pyx_type_4bpf4_4core_Smoother) < 0) __PYX_ERR(0, 2509, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Smoother = &__pyx_type_4bpf4_4core_Smoother;
  __pyx_vtabptr_4bpf4_4core_Halfcos = &__pyx_vtable_4bpf4_4core_Halfcos;
  __pyx_vtable_4bpf4_4core_Halfcos.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfBase;
  __pyx_type_4bpf4_4core_Halfcos.tp_base = __pyx_ptype_4bpf4_4core_BpfBase;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Halfcos) < 0) __PYX_ERR(0, 2529, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Halfcos.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Halfcos.tp_dictoffset && __pyx_type_4bpf4_4core_Halfcos.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Halfcos.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_Halfcos, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 2529, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_7Halfcos___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_7Halfcos___init__.doc = __pyx_doc_4bpf4_4core_7Halfcos___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_7Halfcos___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Halfcos.tp_dict, __pyx_vtabptr_4bpf4_4core_Halfcos) < 0) __PYX_ERR(0, 2529, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Halfcos, (PyObject *)&__pyx_type_4bpf4_4core_Halfcos) < 0) __PYX_ERR(0, 2529, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Halfcos = &__pyx_type_4bpf4_4core_Halfcos;
  __pyx_vtabptr_4bpf4_4core_Halfcosm = &__pyx_vtable_4bpf4_4core_Halfcosm;
  __pyx_vtable_4bpf4_4core_Halfcosm.__pyx_base = *__pyx_vtabptr_4bpf4_4core_Halfcos;
  __pyx_type_4bpf4_4core_Halfcosm.tp_base = __pyx_ptype_4bpf4_4core_Halfcos;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Halfcosm) < 0) __PYX_ERR(0, 2576, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Halfcosm.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Halfcosm.tp_dictoffset && __pyx_type_4bpf4_4core_Halfcosm.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Halfcosm.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Halfcosm.tp_dict, __pyx_vtabptr_4bpf4_4core_Halfcosm) < 0) __PYX_ERR(0, 2576, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Halfcosm, (PyObject *)&__pyx_type_4bpf4_4core_Halfcosm) < 0) __PYX_ERR(0, 2576, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Halfcosm = &__pyx_type_4bpf4_4core_Halfcosm;
  __pyx_vtabptr_4bpf4_4core_Expon = &__pyx_vtable_4bpf4_4core_Expon;
  __pyx_vtable_4bpf4_4core_Expon.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfBase;
  __pyx_type_4bpf4_4core_Expon.tp_base = __pyx_ptype_4bpf4_4core_BpfBase;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Expon) < 0) __PYX_ERR(0, 2599, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Expon.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Expon.tp_dictoffset && __pyx_type_4bpf4_4core_Expon.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Expon.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_Expon, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 2599, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_5Expon___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_5Expon___init__.doc = __pyx_doc_4bpf4_4core_5Expon___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_5Expon___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Expon.tp_dict, __pyx_vtabptr_4bpf4_4core_Expon) < 0) __PYX_ERR(0, 2599, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Expon, (PyObject *)&__pyx_type_4bpf4_4core_Expon) < 0) __PYX_ERR(0, 2599, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Expon = &__pyx_type_4bpf4_4core_Expon;
  __pyx_vtabptr_4bpf4_4core_Exponm = &__pyx_vtable_4bpf4_4core_Exponm;
  __pyx_vtable_4bpf4_4core_Exponm.__pyx_base = *__pyx_vtabptr_4bpf4_4core_Expon;
  __pyx_type_4bpf4_4core_Exponm.tp_base = __pyx_ptype_4bpf4_4core_Expon;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Exponm) < 0) __PYX_ERR(0, 2645, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Exponm.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Exponm.tp_dictoffset && __pyx_type_4bpf4_4core_Exponm.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Exponm.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_Exponm, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 2645, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_6Exponm___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_6Exponm___init__.doc = __pyx_doc_4bpf4_4core_6Exponm___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_6Exponm___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Exponm.tp_dict, __pyx_vtabptr_4bpf4_4core_Exponm) < 0) __PYX_ERR(0, 2645, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Exponm, (PyObject *)&__pyx_type_4bpf4_4core_Exponm) < 0) __PYX_ERR(0, 2645, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Exponm = &__pyx_type_4bpf4_4core_Exponm;
  __pyx_vtabptr_4bpf4_4core_NoInterpol = &__pyx_vtable_4bpf4_4core_NoInterpol;
  __pyx_vtable_4bpf4_4core_NoInterpol.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfBase;
  __pyx_type_4bpf4_4core_NoInterpol.tp_base = __pyx_ptype_4bpf4_4core_BpfBase;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_NoInterpol) < 0) __PYX_ERR(0, 2680, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_NoInterpol.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_NoInterpol.tp_dictoffset && __pyx_type_4bpf4_4core_NoInterpol.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_NoInterpol.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_NoInterpol, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 2680, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_10NoInterpol___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_10NoInterpol___init__.doc = __pyx_doc_4bpf4_4core_10NoInterpol___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_10NoInterpol___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_NoInterpol.tp_dict, __pyx_vtabptr_4bpf4_4core_NoInterpol) < 0) __PYX_ERR(0, 2680, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NoInterpol, (PyObject *)&__pyx_type_4bpf4_4core_NoInterpol) < 0) __PYX_ERR(0, 2680, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_NoInterpol = &__pyx_type_4bpf4_4core_NoInterpol;
  __pyx_vtabptr_4bpf4_4core_Nearest = &__pyx_vtable_4bpf4_4core_Nearest;
  __pyx_vtable_4bpf4_4core_Nearest.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfBase;
  __pyx_type_4bpf4_4core_Nearest.tp_base = __pyx_ptype_4bpf4_4core_BpfBase;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Nearest) < 0) __PYX_ERR(0, 2707, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Nearest.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Nearest.tp_dictoffset && __pyx_type_4bpf4_4core_Nearest.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Nearest.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_Nearest, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 2707, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_7Nearest___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_7Nearest___init__.doc = __pyx_doc_4bpf4_4core_7Nearest___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_7Nearest___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Nearest.tp_dict, __pyx_vtabptr_4bpf4_4core_Nearest) < 0) __PYX_ERR(0, 2707, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Nearest, (PyObject *)&__pyx_type_4bpf4_4core_Nearest) < 0) __PYX_ERR(0, 2707, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Nearest = &__pyx_type_4bpf4_4core_Nearest;
  __pyx_vtabptr_4bpf4_4core_Sampled = &__pyx_vtable_4bpf4_4core_Sampled;
  __pyx_vtable_4bpf4_4core_Sampled.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core_Sampled.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_7Sampled_mapn_between;
  __pyx_vtable_4bpf4_4core_Sampled.__pyx_base.derivative = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_7Sampled_derivative;
  __pyx_vtable_4bpf4_4core_Sampled.__pyx_base.integrate = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_7Sampled_integrate;
  __pyx_vtable_4bpf4_4core_Sampled.__pyx_base.integrate_between = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args))__pyx_f_4bpf4_4core_7Sampled_integrate_between;
  __pyx_vtable_4bpf4_4core_Sampled.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_7Sampled___ccall__;
  __pyx_vtable_4bpf4_4core_Sampled.set_interpolation = (struct __pyx_obj_4bpf4_4core_Sampled *(*)(struct __pyx_obj_4bpf4_4core_Sampled *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_7Sampled_set_interpolation;
  __pyx_type_4bpf4_4core_Sampled.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Sampled) < 0) __PYX_ERR(0, 2839, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Sampled.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Sampled.tp_dictoffset && __pyx_type_4bpf4_4core_Sampled.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Sampled.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_Sampled, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 2839, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_7Sampled___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_7Sampled___init__.doc = __pyx_doc_4bpf4_4core_7Sampled___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_7Sampled___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Sampled.tp_dict, __pyx_vtabptr_4bpf4_4core_Sampled) < 0) __PYX_ERR(0, 2839, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Sampled, (PyObject *)&__pyx_type_4bpf4_4core_Sampled) < 0) __PYX_ERR(0, 2839, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Sampled = &__pyx_type_4bpf4_4core_Sampled;
  __pyx_vtabptr_4bpf4_4core_Spline = &__pyx_vtable_4bpf4_4core_Spline;
  __pyx_vtable_4bpf4_4core_Spline.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core_Spline.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_6Spline___ccall__;
  __pyx_vtable_4bpf4_4core_Spline._points = (PyObject *(*)(struct __pyx_obj_4bpf4_4core_Spline *))__pyx_f_4bpf4_4core_6Spline__points;
  __pyx_type_4bpf4_4core_Spline.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Spline) < 0) __PYX_ERR(0, 3191, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Spline.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Spline.tp_dictoffset && __pyx_type_4bpf4_4core_Spline.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Spline.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_Spline, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 3191, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_6Spline___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_6Spline___init__.doc = __pyx_doc_4bpf4_4core_6Spline___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_6Spline___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Spline.tp_dict, __pyx_vtabptr_4bpf4_4core_Spline) < 0) __PYX_ERR(0, 3191, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Spline, (PyObject *)&__pyx_type_4bpf4_4core_Spline) < 0) __PYX_ERR(0, 3191, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Spline = &__pyx_type_4bpf4_4core_Spline;
  __pyx_vtabptr_4bpf4_4core_USpline = &__pyx_vtable_4bpf4_4core_USpline;
  __pyx_vtable_4bpf4_4core_USpline.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core_USpline.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_7USpline_mapn_between;
  __pyx_vtable_4bpf4_4core_USpline.__pyx_base.map = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map *__pyx_optional_args))__pyx_f_4bpf4_4core_7USpline_map;
  __pyx_vtable_4bpf4_4core_USpline.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_7USpline___ccall__;
  __pyx_type_4bpf4_4core_USpline.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_USpline) < 0) __PYX_ERR(0, 3295, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_USpline.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_USpline.tp_dictoffset && __pyx_type_4bpf4_4core_USpline.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_USpline.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_USpline, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 3295, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_7USpline___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_7USpline___init__.doc = __pyx_doc_4bpf4_4core_7USpline___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_7USpline___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_USpline.tp_dict, __pyx_vtabptr_4bpf4_4core_USpline) < 0) __PYX_ERR(0, 3295, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_USpline, (PyObject *)&__pyx_type_4bpf4_4core_USpline) < 0) __PYX_ERR(0, 3295, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_USpline = &__pyx_type_4bpf4_4core_USpline;
  __pyx_vtabptr_4bpf4_4core__BpfConcat2 = &__pyx_vtable_4bpf4_4core__BpfConcat2;
  __pyx_vtable_4bpf4_4core__BpfConcat2.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfConcat2.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_11_BpfConcat2___ccall__;
  __pyx_type_4bpf4_4core__BpfConcat2.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfConcat2) < 0) __PYX_ERR(0, 3389, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfConcat2.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfConcat2.tp_dictoffset && __pyx_type_4bpf4_4core__BpfConcat2.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfConcat2.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfConcat2.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfConcat2) < 0) __PYX_ERR(0, 3389, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfConcat2, (PyObject *)&__pyx_type_4bpf4_4core__BpfConcat2) < 0) __PYX_ERR(0, 3389, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfConcat2 = &__pyx_type_4bpf4_4core__BpfConcat2;
  __pyx_vtabptr_4bpf4_4core_Slope = &__pyx_vtable_4bpf4_4core_Slope;
  __pyx_vtable_4bpf4_4core_Slope.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core_Slope.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_5Slope_mapn_between;
  __pyx_vtable_4bpf4_4core_Slope.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_5Slope___ccall__;
  __pyx_vtable_4bpf4_4core_Slope.__pyx_base._slice = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_5Slope__slice__pyx_wrap_1;
  __pyx_vtable_4bpf4_4core_Slope._slice = (struct __pyx_obj_4bpf4_4core_Slope *(*)(struct __pyx_obj_4bpf4_4core_Slope *, double, double, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_5Slope__slice;
  __pyx_type_4bpf4_4core_Slope.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Slope) < 0) __PYX_ERR(0, 3408, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Slope.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Slope.tp_dictoffset && __pyx_type_4bpf4_4core_Slope.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Slope.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_Slope, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 3408, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_5Slope___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_5Slope___init__.doc = __pyx_doc_4bpf4_4core_5Slope___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_5Slope___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Slope.tp_dict, __pyx_vtabptr_4bpf4_4core_Slope) < 0) __PYX_ERR(0, 3408, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Slope, (PyObject *)&__pyx_type_4bpf4_4core_Slope) < 0) __PYX_ERR(0, 3408, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Slope = &__pyx_type_4bpf4_4core_Slope;
  __pyx_vtabptr_4bpf4_4core__BpfCompose = &__pyx_vtable_4bpf4_4core__BpfCompose;
  __pyx_vtable_4bpf4_4core__BpfCompose.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfCompose.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_11_BpfCompose_mapn_between;
  __pyx_vtable_4bpf4_4core__BpfCompose.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_11_BpfCompose___ccall__;
  __pyx_type_4bpf4_4core__BpfCompose.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfCompose) < 0) __PYX_ERR(0, 3512, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfCompose.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfCompose.tp_dictoffset && __pyx_type_4bpf4_4core__BpfCompose.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfCompose.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfCompose.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfCompose) < 0) __PYX_ERR(0, 3512, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfCompose, (PyObject *)&__pyx_type_4bpf4_4core__BpfCompose) < 0) __PYX_ERR(0, 3512, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfCompose = &__pyx_type_4bpf4_4core__BpfCompose;
  __pyx_vtabptr_4bpf4_4core__BpfConcat = &__pyx_vtable_4bpf4_4core__BpfConcat;
  __pyx_vtable_4bpf4_4core__BpfConcat.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfConcat.__pyx_base.concat = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_10_BpfConcat_concat__pyx_wrap_1;
  __pyx_vtable_4bpf4_4core__BpfConcat.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_10_BpfConcat___ccall__;
  __pyx_vtable_4bpf4_4core__BpfConcat.concat = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core__BpfConcat *, struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_10_BpfConcat_concat *__pyx_optional_args))__pyx_f_4bpf4_4core_10_BpfConcat_concat;
  __pyx_type_4bpf4_4core__BpfConcat.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfConcat) < 0) __PYX_ERR(0, 3576, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfConcat.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfConcat.tp_dictoffset && __pyx_type_4bpf4_4core__BpfConcat.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfConcat.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core__BpfConcat, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 3576, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_10_BpfConcat_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_10_BpfConcat_2__init__.doc = __pyx_doc_4bpf4_4core_10_BpfConcat_2__init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_10_BpfConcat_2__init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfConcat.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfConcat) < 0) __PYX_ERR(0, 3576, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfConcat, (PyObject *)&__pyx_type_4bpf4_4core__BpfConcat) < 0) __PYX_ERR(0, 3576, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfConcat = &__pyx_type_4bpf4_4core__BpfConcat;
  __pyx_vtabptr_4bpf4_4core__BpfBlend = &__pyx_vtable_4bpf4_4core__BpfBlend;
  __pyx_vtable_4bpf4_4core__BpfBlend.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfBlend.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_9_BpfBlend___ccall__;
  __pyx_type_4bpf4_4core__BpfBlend.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfBlend) < 0) __PYX_ERR(0, 3656, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfBlend.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfBlend.tp_dictoffset && __pyx_type_4bpf4_4core__BpfBlend.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfBlend.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core__BpfBlend, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 3656, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_9_BpfBlend___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_9_BpfBlend___init__.doc = __pyx_doc_4bpf4_4core_9_BpfBlend___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_9_BpfBlend___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfBlend.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfBlend) < 0) __PYX_ERR(0, 3656, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfBlend, (PyObject *)&__pyx_type_4bpf4_4core__BpfBlend) < 0) __PYX_ERR(0, 3656, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfBlend = &__pyx_type_4bpf4_4core__BpfBlend;
  __pyx_vtabptr_4bpf4_4core__BpfBlendConst = &__pyx_vtable_4bpf4_4core__BpfBlendConst;
  __pyx_vtable_4bpf4_4core__BpfBlendConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfBlendConst.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_14_BpfBlendConst___ccall__;
  __pyx_type_4bpf4_4core__BpfBlendConst.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfBlendConst) < 0) __PYX_ERR(0, 3686, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfBlendConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfBlendConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfBlendConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfBlendConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core__BpfBlendConst, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 3686, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_14_BpfBlendConst___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_14_BpfBlendConst___init__.doc = __pyx_doc_4bpf4_4core_14_BpfBlendConst___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_14_BpfBlendConst___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfBlendConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfBlendConst) < 0) __PYX_ERR(0, 3686, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfBlendConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfBlendConst) < 0) __PYX_ERR(0, 3686, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfBlendConst = &__pyx_type_4bpf4_4core__BpfBlendConst;
  __pyx_vtabptr_4bpf4_4core_Multi = &__pyx_vtable_4bpf4_4core_Multi;
  __pyx_vtable_4bpf4_4core_Multi.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core_Multi.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_5Multi___ccall__;
  __pyx_type_4bpf4_4core_Multi.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Multi) < 0) __PYX_ERR(0, 3710, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Multi.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Multi.tp_dictoffset && __pyx_type_4bpf4_4core_Multi.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Multi.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_Multi, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 3710, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_5Multi_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_5Multi_2__init__.doc = __pyx_doc_4bpf4_4core_5Multi_2__init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_5Multi_2__init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Multi.tp_dict, __pyx_vtabptr_4bpf4_4core_Multi) < 0) __PYX_ERR(0, 3710, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Multi, (PyObject *)&__pyx_type_4bpf4_4core_Multi) < 0) __PYX_ERR(0, 3710, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Multi = &__pyx_type_4bpf4_4core_Multi;
  __pyx_vtabptr_4bpf4_4core__FunctionWrap_Object = &__pyx_vtable_4bpf4_4core__FunctionWrap_Object;
  __pyx_vtable_4bpf4_4core__FunctionWrap_Object.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__FunctionWrap_Object.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_20_FunctionWrap_Object_mapn_between;
  __pyx_vtable_4bpf4_4core__FunctionWrap_Object.__pyx_base.map = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map *__pyx_optional_args))__pyx_f_4bpf4_4core_20_FunctionWrap_Object_map;
  __pyx_vtable_4bpf4_4core__FunctionWrap_Object.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_20_FunctionWrap_Object___ccall__;
  __pyx_vtable_4bpf4_4core__FunctionWrap_Object.__pyx_base._slice = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_20_FunctionWrap_Object__slice;
  __pyx_type_4bpf4_4core__FunctionWrap_Object.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__FunctionWrap_Object) < 0) __PYX_ERR(0, 3824, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__FunctionWrap_Object.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__FunctionWrap_Object.tp_dictoffset && __pyx_type_4bpf4_4core__FunctionWrap_Object.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__FunctionWrap_Object.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core__FunctionWrap_Object, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 3824, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_20_FunctionWrap_Object___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_20_FunctionWrap_Object___init__.doc = __pyx_doc_4bpf4_4core_20_FunctionWrap_Object___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_20_FunctionWrap_Object___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__FunctionWrap_Object.tp_dict, __pyx_vtabptr_4bpf4_4core__FunctionWrap_Object) < 0) __PYX_ERR(0, 3824, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FunctionWrap_Object, (PyObject *)&__pyx_type_4bpf4_4core__FunctionWrap_Object) < 0) __PYX_ERR(0, 3824, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__FunctionWrap_Object = &__pyx_type_4bpf4_4core__FunctionWrap_Object;
  __pyx_vtabptr_4bpf4_4core__FunctionWrap_Object_OutboundConst = &__pyx_vtable_4bpf4_4core__FunctionWrap_Object_OutboundConst;
  __pyx_vtable_4bpf4_4core__FunctionWrap_Object_OutboundConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__FunctionWrap_Object;
  __pyx_vtable_4bpf4_4core__FunctionWrap_Object_OutboundConst.__pyx_base.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_34_FunctionWrap_Object_OutboundConst___ccall__;
  __pyx_type_4bpf4_4core__FunctionWrap_Object_OutboundConst.tp_base = __pyx_ptype_4bpf4_4core__FunctionWrap_Object;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__FunctionWrap_Object_OutboundConst) < 0) __PYX_ERR(0, 3909, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__FunctionWrap_Object_OutboundConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__FunctionWrap_Object_OutboundConst.tp_dictoffset && __pyx_type_4bpf4_4core__FunctionWrap_Object_OutboundConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__FunctionWrap_Object_OutboundConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__FunctionWrap_Object_OutboundConst.tp_dict, __pyx_vtabptr_4bpf4_4core__FunctionWrap_Object_OutboundConst) < 0) __PYX_ERR(0, 3909, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FunctionWrap_Object_OutboundCon, (PyObject *)&__pyx_type_4bpf4_4core__FunctionWrap_Object_OutboundConst) < 0) __PYX_ERR(0, 3909, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__FunctionWrap_Object_OutboundConst = &__pyx_type_4bpf4_4core__FunctionWrap_Object_OutboundConst;
  __pyx_vtabptr_4bpf4_4core_Const = &__pyx_vtable_4bpf4_4core_Const;
  __pyx_vtable_4bpf4_4core_Const.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core_Const.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_5Const_mapn_between;
  __pyx_vtable_4bpf4_4core_Const.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_5Const___ccall__;
  __pyx_type_4bpf4_4core_Const.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Const) < 0) __PYX_ERR(0, 3928, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Const.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Const.tp_dictoffset && __pyx_type_4bpf4_4core_Const.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Const.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core_Const, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 3928, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_5Const___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_5Const___init__.doc = __pyx_doc_4bpf4_4core_5Const___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_5Const___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Const.tp_dict, __pyx_vtabptr_4bpf4_4core_Const) < 0) __PYX_ERR(0, 3928, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Const, (PyObject *)&__pyx_type_4bpf4_4core_Const) < 0) __PYX_ERR(0, 3928, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Const = &__pyx_type_4bpf4_4core_Const;
  __pyx_vtabptr_4bpf4_4core__BpfBinOp = &__pyx_vtable_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfBinOp.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfBinOp.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_9_BpfBinOp_mapn_between;
  __pyx_vtable_4bpf4_4core__BpfBinOp.__pyx_base.map = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map *__pyx_optional_args))__pyx_f_4bpf4_4core_9_BpfBinOp_map;
  __pyx_vtable_4bpf4_4core__BpfBinOp.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_9_BpfBinOp___ccall__;
  __pyx_vtable_4bpf4_4core__BpfBinOp._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_9_BpfBinOp__apply;
  __pyx_type_4bpf4_4core__BpfBinOp.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfBinOp) < 0) __PYX_ERR(0, 4019, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfBinOp.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfBinOp.tp_dictoffset && __pyx_type_4bpf4_4core__BpfBinOp.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfBinOp.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfBinOp.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfBinOp) < 0) __PYX_ERR(0, 4019, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfBinOp, (PyObject *)&__pyx_type_4bpf4_4core__BpfBinOp) < 0) __PYX_ERR(0, 4019, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfBinOp = &__pyx_type_4bpf4_4core__BpfBinOp;
  __pyx_vtabptr_4bpf4_4core__BpfUnaryFunc = &__pyx_vtable_4bpf4_4core__BpfUnaryFunc;
  __pyx_vtable_4bpf4_4core__BpfUnaryFunc.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfUnaryFunc.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_13_BpfUnaryFunc_mapn_between;
  __pyx_vtable_4bpf4_4core__BpfUnaryFunc.__pyx_base.map = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map *__pyx_optional_args))__pyx_f_4bpf4_4core_13_BpfUnaryFunc_map;
  __pyx_vtable_4bpf4_4core__BpfUnaryFunc.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_13_BpfUnaryFunc___ccall__;
  __pyx_vtable_4bpf4_4core__BpfUnaryFunc._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfUnaryFunc *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_13_BpfUnaryFunc__apply;
  __pyx_type_4bpf4_4core__BpfUnaryFunc.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfUnaryFunc) < 0) __PYX_ERR(0, 4081, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfUnaryFunc.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfUnaryFunc.tp_dictoffset && __pyx_type_4bpf4_4core__BpfUnaryFunc.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfUnaryFunc.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfUnaryFunc.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfUnaryFunc) < 0) __PYX_ERR(0, 4081, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfUnaryFunc, (PyObject *)&__pyx_type_4bpf4_4core__BpfUnaryFunc) < 0) __PYX_ERR(0, 4081, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfUnaryFunc = &__pyx_type_4bpf4_4core__BpfUnaryFunc;
  __pyx_vtabptr_4bpf4_4core__BpfUnaryOp = &__pyx_vtable_4bpf4_4core__BpfUnaryOp;
  __pyx_vtable_4bpf4_4core__BpfUnaryOp.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfUnaryOp.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_11_BpfUnaryOp_mapn_between;
  __pyx_vtable_4bpf4_4core__BpfUnaryOp.__pyx_base.map = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map *__pyx_optional_args))__pyx_f_4bpf4_4core_11_BpfUnaryOp_map;
  __pyx_vtable_4bpf4_4core__BpfUnaryOp.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_11_BpfUnaryOp___ccall__;
  __pyx_vtable_4bpf4_4core__BpfUnaryOp._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_11_BpfUnaryOp__apply;
  __pyx_type_4bpf4_4core__BpfUnaryOp.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfUnaryOp) < 0) __PYX_ERR(0, 4146, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfUnaryOp.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfUnaryOp.tp_dictoffset && __pyx_type_4bpf4_4core__BpfUnaryOp.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfUnaryOp.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfUnaryOp.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfUnaryOp) < 0) __PYX_ERR(0, 4146, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfUnaryOp, (PyObject *)&__pyx_type_4bpf4_4core__BpfUnaryOp) < 0) __PYX_ERR(0, 4146, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfUnaryOp = &__pyx_type_4bpf4_4core__BpfUnaryOp;
  __pyx_vtabptr_4bpf4_4core__BpfBinOpConst = &__pyx_vtable_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfBinOpConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfBinOpConst.__pyx_base.map = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_map *__pyx_optional_args))__pyx_f_4bpf4_4core_14_BpfBinOpConst_map;
  __pyx_vtable_4bpf4_4core__BpfBinOpConst.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_14_BpfBinOpConst___ccall__;
  __pyx_vtable_4bpf4_4core__BpfBinOpConst._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_14_BpfBinOpConst__apply;
  __pyx_type_4bpf4_4core__BpfBinOpConst.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfBinOpConst) < 0) __PYX_ERR(0, 4196, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfBinOpConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfBinOpConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfBinOpConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfBinOpConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfBinOpConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfBinOpConst) < 0) __PYX_ERR(0, 4196, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfBinOpConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfBinOpConst) < 0) __PYX_ERR(0, 4196, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfBinOpConst = &__pyx_type_4bpf4_4core__BpfBinOpConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaAdd = &__pyx_vtable_4bpf4_4core__BpfLambdaAdd;
  __pyx_vtable_4bpf4_4core__BpfLambdaAdd.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaAdd.__pyx_base.__pyx_base.integrate_between = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args))__pyx_f_4bpf4_4core_13_BpfLambdaAdd_integrate_between;
  __pyx_vtable_4bpf4_4core__BpfLambdaAdd.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_13_BpfLambdaAdd__apply;
  __pyx_type_4bpf4_4core__BpfLambdaAdd.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaAdd) < 0) __PYX_ERR(0, 4255, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaAdd.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaAdd.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaAdd.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaAdd.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaAdd.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaAdd) < 0) __PYX_ERR(0, 4255, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaAdd, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaAdd) < 0) __PYX_ERR(0, 4255, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaAdd = &__pyx_type_4bpf4_4core__BpfLambdaAdd;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaAddConst = &__pyx_vtable_4bpf4_4core__BpfLambdaAddConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaAddConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaAddConst.__pyx_base.__pyx_base.integrate_between = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args))__pyx_f_4bpf4_4core_18_BpfLambdaAddConst_integrate_between;
  __pyx_vtable_4bpf4_4core__BpfLambdaAddConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_18_BpfLambdaAddConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaAddConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaAddConst) < 0) __PYX_ERR(0, 4264, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaAddConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaAddConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaAddConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaAddConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaAddConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaAddConst) < 0) __PYX_ERR(0, 4264, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaAddConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaAddConst) < 0) __PYX_ERR(0, 4264, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaAddConst = &__pyx_type_4bpf4_4core__BpfLambdaAddConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaSub = &__pyx_vtable_4bpf4_4core__BpfLambdaSub;
  __pyx_vtable_4bpf4_4core__BpfLambdaSub.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaSub.__pyx_base.__pyx_base.integrate_between = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args))__pyx_f_4bpf4_4core_13_BpfLambdaSub_integrate_between;
  __pyx_vtable_4bpf4_4core__BpfLambdaSub.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_13_BpfLambdaSub__apply;
  __pyx_type_4bpf4_4core__BpfLambdaSub.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaSub) < 0) __PYX_ERR(0, 4288, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaSub.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaSub.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaSub.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaSub.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaSub.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaSub) < 0) __PYX_ERR(0, 4288, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaSub, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaSub) < 0) __PYX_ERR(0, 4288, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaSub = &__pyx_type_4bpf4_4core__BpfLambdaSub;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaRSub = &__pyx_vtable_4bpf4_4core__BpfLambdaRSub;
  __pyx_vtable_4bpf4_4core__BpfLambdaRSub.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaRSub.__pyx_base.__pyx_base.integrate_between = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args))__pyx_f_4bpf4_4core_14_BpfLambdaRSub_integrate_between;
  __pyx_vtable_4bpf4_4core__BpfLambdaRSub.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_14_BpfLambdaRSub__apply;
  __pyx_type_4bpf4_4core__BpfLambdaRSub.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaRSub) < 0) __PYX_ERR(0, 4296, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaRSub.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaRSub.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaRSub.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaRSub.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaRSub.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaRSub) < 0) __PYX_ERR(0, 4296, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaRSub, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaRSub) < 0) __PYX_ERR(0, 4296, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaRSub = &__pyx_type_4bpf4_4core__BpfLambdaRSub;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaSubConst = &__pyx_vtable_4bpf4_4core__BpfLambdaSubConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaSubConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaSubConst.__pyx_base.__pyx_base.integrate_between = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args))__pyx_f_4bpf4_4core_18_BpfLambdaSubConst_integrate_between;
  __pyx_vtable_4bpf4_4core__BpfLambdaSubConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_18_BpfLambdaSubConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaSubConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaSubConst) < 0) __PYX_ERR(0, 4304, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaSubConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaSubConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaSubConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaSubConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaSubConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaSubConst) < 0) __PYX_ERR(0, 4304, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaSubConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaSubConst) < 0) __PYX_ERR(0, 4304, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaSubConst = &__pyx_type_4bpf4_4core__BpfLambdaSubConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaRSubConst = &__pyx_vtable_4bpf4_4core__BpfLambdaRSubConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaRSubConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaRSubConst.__pyx_base.__pyx_base.integrate_between = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args))__pyx_f_4bpf4_4core_19_BpfLambdaRSubConst_integrate_between;
  __pyx_vtable_4bpf4_4core__BpfLambdaRSubConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_19_BpfLambdaRSubConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaRSubConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaRSubConst) < 0) __PYX_ERR(0, 4312, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaRSubConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaRSubConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaRSubConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaRSubConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaRSubConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaRSubConst) < 0) __PYX_ERR(0, 4312, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaRSubConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaRSubConst) < 0) __PYX_ERR(0, 4312, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaRSubConst = &__pyx_type_4bpf4_4core__BpfLambdaRSubConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaMul = &__pyx_vtable_4bpf4_4core__BpfLambdaMul;
  __pyx_vtable_4bpf4_4core__BpfLambdaMul.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaMul.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_13_BpfLambdaMul__apply;
  __pyx_type_4bpf4_4core__BpfLambdaMul.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaMul) < 0) __PYX_ERR(0, 4320, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaMul.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaMul.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaMul.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaMul.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaMul.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaMul) < 0) __PYX_ERR(0, 4320, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaMul, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaMul) < 0) __PYX_ERR(0, 4320, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaMul = &__pyx_type_4bpf4_4core__BpfLambdaMul;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaMulConst = &__pyx_vtable_4bpf4_4core__BpfLambdaMulConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaMulConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaMulConst.__pyx_base.__pyx_base.integrate_between = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args))__pyx_f_4bpf4_4core_18_BpfLambdaMulConst_integrate_between;
  __pyx_vtable_4bpf4_4core__BpfLambdaMulConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_18_BpfLambdaMulConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaMulConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaMulConst) < 0) __PYX_ERR(0, 4326, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaMulConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaMulConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaMulConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaMulConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaMulConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaMulConst) < 0) __PYX_ERR(0, 4326, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaMulConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaMulConst) < 0) __PYX_ERR(0, 4326, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaMulConst = &__pyx_type_4bpf4_4core__BpfLambdaMulConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaPow = &__pyx_vtable_4bpf4_4core__BpfLambdaPow;
  __pyx_vtable_4bpf4_4core__BpfLambdaPow.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaPow.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_13_BpfLambdaPow__apply;
  __pyx_type_4bpf4_4core__BpfLambdaPow.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaPow) < 0) __PYX_ERR(0, 4334, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaPow.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaPow.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaPow.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaPow.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaPow.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaPow) < 0) __PYX_ERR(0, 4334, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaPow, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaPow) < 0) __PYX_ERR(0, 4334, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaPow = &__pyx_type_4bpf4_4core__BpfLambdaPow;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaPowConst = &__pyx_vtable_4bpf4_4core__BpfLambdaPowConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaPowConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaPowConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_18_BpfLambdaPowConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaPowConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaPowConst) < 0) __PYX_ERR(0, 4340, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaPowConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaPowConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaPowConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaPowConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaPowConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaPowConst) < 0) __PYX_ERR(0, 4340, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaPowConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaPowConst) < 0) __PYX_ERR(0, 4340, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaPowConst = &__pyx_type_4bpf4_4core__BpfLambdaPowConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaRPowConst = &__pyx_vtable_4bpf4_4core__BpfLambdaRPowConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaRPowConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaRPowConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_19_BpfLambdaRPowConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaRPowConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaRPowConst) < 0) __PYX_ERR(0, 4346, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaRPowConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaRPowConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaRPowConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaRPowConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaRPowConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaRPowConst) < 0) __PYX_ERR(0, 4346, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaRPowConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaRPowConst) < 0) __PYX_ERR(0, 4346, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaRPowConst = &__pyx_type_4bpf4_4core__BpfLambdaRPowConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaDiv = &__pyx_vtable_4bpf4_4core__BpfLambdaDiv;
  __pyx_vtable_4bpf4_4core__BpfLambdaDiv.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaDiv.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_13_BpfLambdaDiv__apply;
  __pyx_type_4bpf4_4core__BpfLambdaDiv.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaDiv) < 0) __PYX_ERR(0, 4352, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaDiv.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaDiv.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaDiv.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaDiv.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaDiv.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaDiv) < 0) __PYX_ERR(0, 4352, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaDiv, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaDiv) < 0) __PYX_ERR(0, 4352, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaDiv = &__pyx_type_4bpf4_4core__BpfLambdaDiv;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaDivConst = &__pyx_vtable_4bpf4_4core__BpfLambdaDivConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaDivConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaDivConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_18_BpfLambdaDivConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaDivConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaDivConst) < 0) __PYX_ERR(0, 4359, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaDivConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaDivConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaDivConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaDivConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaDivConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaDivConst) < 0) __PYX_ERR(0, 4359, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaDivConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaDivConst) < 0) __PYX_ERR(0, 4359, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaDivConst = &__pyx_type_4bpf4_4core__BpfLambdaDivConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaMod = &__pyx_vtable_4bpf4_4core__BpfLambdaMod;
  __pyx_vtable_4bpf4_4core__BpfLambdaMod.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaMod.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_13_BpfLambdaMod__apply;
  __pyx_type_4bpf4_4core__BpfLambdaMod.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaMod) < 0) __PYX_ERR(0, 4366, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaMod.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaMod.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaMod.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaMod.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaMod.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaMod) < 0) __PYX_ERR(0, 4366, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaMod, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaMod) < 0) __PYX_ERR(0, 4366, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaMod = &__pyx_type_4bpf4_4core__BpfLambdaMod;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaModConst = &__pyx_vtable_4bpf4_4core__BpfLambdaModConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaModConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaModConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_18_BpfLambdaModConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaModConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaModConst) < 0) __PYX_ERR(0, 4373, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaModConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaModConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaModConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaModConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaModConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaModConst) < 0) __PYX_ERR(0, 4373, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaModConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaModConst) < 0) __PYX_ERR(0, 4373, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaModConst = &__pyx_type_4bpf4_4core__BpfLambdaModConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaRDiv = &__pyx_vtable_4bpf4_4core__BpfLambdaRDiv;
  __pyx_vtable_4bpf4_4core__BpfLambdaRDiv.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaRDiv.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_14_BpfLambdaRDiv__apply;
  __pyx_type_4bpf4_4core__BpfLambdaRDiv.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaRDiv) < 0) __PYX_ERR(0, 4380, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaRDiv.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaRDiv.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaRDiv.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaRDiv.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaRDiv.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaRDiv) < 0) __PYX_ERR(0, 4380, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaRDiv, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaRDiv) < 0) __PYX_ERR(0, 4380, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaRDiv = &__pyx_type_4bpf4_4core__BpfLambdaRDiv;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaRDivConst = &__pyx_vtable_4bpf4_4core__BpfLambdaRDivConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaRDivConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaRDivConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_19_BpfLambdaRDivConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaRDivConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaRDivConst) < 0) __PYX_ERR(0, 4387, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaRDivConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaRDivConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaRDivConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaRDivConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaRDivConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaRDivConst) < 0) __PYX_ERR(0, 4387, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaRDivConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaRDivConst) < 0) __PYX_ERR(0, 4387, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaRDivConst = &__pyx_type_4bpf4_4core__BpfLambdaRDivConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterThan = &__pyx_vtable_4bpf4_4core__BpfLambdaGreaterThan;
  __pyx_vtable_4bpf4_4core__BpfLambdaGreaterThan.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaGreaterThan.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_21_BpfLambdaGreaterThan__apply;
  __pyx_type_4bpf4_4core__BpfLambdaGreaterThan.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaGreaterThan) < 0) __PYX_ERR(0, 4394, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaGreaterThan.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaGreaterThan.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaGreaterThan.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaGreaterThan.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaGreaterThan.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterThan) < 0) __PYX_ERR(0, 4394, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaGreaterThan, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaGreaterThan) < 0) __PYX_ERR(0, 4394, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaGreaterThan = &__pyx_type_4bpf4_4core__BpfLambdaGreaterThan;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterOrEqualThan = &__pyx_vtable_4bpf4_4core__BpfLambdaGreaterOrEqualThan;
  __pyx_vtable_4bpf4_4core__BpfLambdaGreaterOrEqualThan.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaGreaterOrEqualThan.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_28_BpfLambdaGreaterOrEqualThan__apply;
  __pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThan.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThan) < 0) __PYX_ERR(0, 4400, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThan.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThan.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThan.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThan.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThan.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterOrEqualThan) < 0) __PYX_ERR(0, 4400, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaGreaterOrEqualThan, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThan) < 0) __PYX_ERR(0, 4400, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaGreaterOrEqualThan = &__pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThan;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterThanConst = &__pyx_vtable_4bpf4_4core__BpfLambdaGreaterThanConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaGreaterThanConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaGreaterThanConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_26_BpfLambdaGreaterThanConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaGreaterThanConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaGreaterThanConst) < 0) __PYX_ERR(0, 4406, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaGreaterThanConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaGreaterThanConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaGreaterThanConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaGreaterThanConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaGreaterThanConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterThanConst) < 0) __PYX_ERR(0, 4406, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaGreaterThanConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaGreaterThanConst) < 0) __PYX_ERR(0, 4406, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaGreaterThanConst = &__pyx_type_4bpf4_4core__BpfLambdaGreaterThanConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst = &__pyx_vtable_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_33_BpfLambdaGreaterOrEqualThanConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst) < 0) __PYX_ERR(0, 4412, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst) < 0) __PYX_ERR(0, 4412, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaGreaterOrEqualThanCons, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst) < 0) __PYX_ERR(0, 4412, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst = &__pyx_type_4bpf4_4core__BpfLambdaGreaterOrEqualThanConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaLowerThan = &__pyx_vtable_4bpf4_4core__BpfLambdaLowerThan;
  __pyx_vtable_4bpf4_4core__BpfLambdaLowerThan.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaLowerThan.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_19_BpfLambdaLowerThan__apply;
  __pyx_type_4bpf4_4core__BpfLambdaLowerThan.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaLowerThan) < 0) __PYX_ERR(0, 4418, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaLowerThan.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaLowerThan.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaLowerThan.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaLowerThan.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaLowerThan.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaLowerThan) < 0) __PYX_ERR(0, 4418, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaLowerThan, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaLowerThan) < 0) __PYX_ERR(0, 4418, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaLowerThan = &__pyx_type_4bpf4_4core__BpfLambdaLowerThan;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaLowerThanConst = &__pyx_vtable_4bpf4_4core__BpfLambdaLowerThanConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaLowerThanConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaLowerThanConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_24_BpfLambdaLowerThanConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaLowerThanConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaLowerThanConst) < 0) __PYX_ERR(0, 4424, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaLowerThanConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaLowerThanConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaLowerThanConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaLowerThanConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaLowerThanConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaLowerThanConst) < 0) __PYX_ERR(0, 4424, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaLowerThanConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaLowerThanConst) < 0) __PYX_ERR(0, 4424, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaLowerThanConst = &__pyx_type_4bpf4_4core__BpfLambdaLowerThanConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaLowerOrEqualThan = &__pyx_vtable_4bpf4_4core__BpfLambdaLowerOrEqualThan;
  __pyx_vtable_4bpf4_4core__BpfLambdaLowerOrEqualThan.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaLowerOrEqualThan.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_26_BpfLambdaLowerOrEqualThan__apply;
  __pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThan.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThan) < 0) __PYX_ERR(0, 4430, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThan.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThan.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThan.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThan.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThan.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaLowerOrEqualThan) < 0) __PYX_ERR(0, 4430, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaLowerOrEqualThan, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThan) < 0) __PYX_ERR(0, 4430, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaLowerOrEqualThan = &__pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThan;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaLowerOrEqualThanConst = &__pyx_vtable_4bpf4_4core__BpfLambdaLowerOrEqualThanConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaLowerOrEqualThanConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaLowerOrEqualThanConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_31_BpfLambdaLowerOrEqualThanConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThanConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThanConst) < 0) __PYX_ERR(0, 4436, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThanConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThanConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThanConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThanConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThanConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaLowerOrEqualThanConst) < 0) __PYX_ERR(0, 4436, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaLowerOrEqualThanConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThanConst) < 0) __PYX_ERR(0, 4436, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaLowerOrEqualThanConst = &__pyx_type_4bpf4_4core__BpfLambdaLowerOrEqualThanConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaEqual = &__pyx_vtable_4bpf4_4core__BpfLambdaEqual;
  __pyx_vtable_4bpf4_4core__BpfLambdaEqual.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaEqual.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_15_BpfLambdaEqual__apply;
  __pyx_type_4bpf4_4core__BpfLambdaEqual.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaEqual) < 0) __PYX_ERR(0, 4442, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaEqual.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaEqual.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaEqual.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaEqual.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaEqual.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaEqual) < 0) __PYX_ERR(0, 4442, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaEqual, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaEqual) < 0) __PYX_ERR(0, 4442, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaEqual = &__pyx_type_4bpf4_4core__BpfLambdaEqual;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaEqualConst = &__pyx_vtable_4bpf4_4core__BpfLambdaEqualConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaEqualConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaEqualConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_20_BpfLambdaEqualConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaEqualConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaEqualConst) < 0) __PYX_ERR(0, 4448, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaEqualConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaEqualConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaEqualConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaEqualConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaEqualConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaEqualConst) < 0) __PYX_ERR(0, 4448, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaEqualConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaEqualConst) < 0) __PYX_ERR(0, 4448, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaEqualConst = &__pyx_type_4bpf4_4core__BpfLambdaEqualConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaUnequal = &__pyx_vtable_4bpf4_4core__BpfLambdaUnequal;
  __pyx_vtable_4bpf4_4core__BpfLambdaUnequal.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaUnequal.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOp *, __pyx_t_4bpf4_4core_DTYPE_t *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_17_BpfLambdaUnequal__apply;
  __pyx_type_4bpf4_4core__BpfLambdaUnequal.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaUnequal) < 0) __PYX_ERR(0, 4454, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaUnequal.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaUnequal.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaUnequal.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaUnequal.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaUnequal.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaUnequal) < 0) __PYX_ERR(0, 4454, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaUnequal, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaUnequal) < 0) __PYX_ERR(0, 4454, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaUnequal = &__pyx_type_4bpf4_4core__BpfLambdaUnequal;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaUnequalConst = &__pyx_vtable_4bpf4_4core__BpfLambdaUnequalConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaUnequalConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaUnequalConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_22_BpfLambdaUnequalConst__apply;
  __pyx_type_4bpf4_4core__BpfLambdaUnequalConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaUnequalConst) < 0) __PYX_ERR(0, 4460, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaUnequalConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaUnequalConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaUnequalConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaUnequalConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaUnequalConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaUnequalConst) < 0) __PYX_ERR(0, 4460, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaUnequalConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaUnequalConst) < 0) __PYX_ERR(0, 4460, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaUnequalConst = &__pyx_type_4bpf4_4core__BpfLambdaUnequalConst;
  __pyx_vtabptr_4bpf4_4core__BpfMaxConst = &__pyx_vtable_4bpf4_4core__BpfMaxConst;
  __pyx_vtable_4bpf4_4core__BpfMaxConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfMaxConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_12_BpfMaxConst__apply;
  __pyx_type_4bpf4_4core__BpfMaxConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfMaxConst) < 0) __PYX_ERR(0, 4466, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfMaxConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfMaxConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfMaxConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfMaxConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfMaxConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfMaxConst) < 0) __PYX_ERR(0, 4466, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfMaxConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfMaxConst) < 0) __PYX_ERR(0, 4466, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfMaxConst = &__pyx_type_4bpf4_4core__BpfMaxConst;
  __pyx_vtabptr_4bpf4_4core__BpfMinConst = &__pyx_vtable_4bpf4_4core__BpfMinConst;
  __pyx_vtable_4bpf4_4core__BpfMinConst.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfMinConst.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_12_BpfMinConst__apply;
  __pyx_type_4bpf4_4core__BpfMinConst.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfMinConst) < 0) __PYX_ERR(0, 4474, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfMinConst.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfMinConst.tp_dictoffset && __pyx_type_4bpf4_4core__BpfMinConst.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfMinConst.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfMinConst.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfMinConst) < 0) __PYX_ERR(0, 4474, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfMinConst, (PyObject *)&__pyx_type_4bpf4_4core__BpfMinConst) < 0) __PYX_ERR(0, 4474, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfMinConst = &__pyx_type_4bpf4_4core__BpfMinConst;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaLog = &__pyx_vtable_4bpf4_4core__BpfLambdaLog;
  __pyx_vtable_4bpf4_4core__BpfLambdaLog.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfBinOpConst;
  __pyx_vtable_4bpf4_4core__BpfLambdaLog.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfBinOpConst *, __pyx_t_4bpf4_4core_DTYPE_t *, int, double))__pyx_f_4bpf4_4core_13_BpfLambdaLog__apply;
  __pyx_type_4bpf4_4core__BpfLambdaLog.tp_base = __pyx_ptype_4bpf4_4core__BpfBinOpConst;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaLog) < 0) __PYX_ERR(0, 4482, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaLog.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaLog.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaLog.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaLog.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaLog.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaLog) < 0) __PYX_ERR(0, 4482, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaLog, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaLog) < 0) __PYX_ERR(0, 4482, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaLog = &__pyx_type_4bpf4_4core__BpfLambdaLog;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaRound = &__pyx_vtable_4bpf4_4core__BpfLambdaRound;
  __pyx_vtable_4bpf4_4core__BpfLambdaRound.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfUnaryOp;
  __pyx_vtable_4bpf4_4core__BpfLambdaRound.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_15_BpfLambdaRound__apply;
  __pyx_type_4bpf4_4core__BpfLambdaRound.tp_base = __pyx_ptype_4bpf4_4core__BpfUnaryOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaRound) < 0) __PYX_ERR(0, 4493, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaRound.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaRound.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaRound.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaRound.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaRound.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaRound) < 0) __PYX_ERR(0, 4493, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaRound, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaRound) < 0) __PYX_ERR(0, 4493, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaRound = &__pyx_type_4bpf4_4core__BpfLambdaRound;
  __pyx_vtabptr_4bpf4_4core__BpfRand = &__pyx_vtable_4bpf4_4core__BpfRand;
  __pyx_vtable_4bpf4_4core__BpfRand.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfUnaryOp;
  __pyx_vtable_4bpf4_4core__BpfRand.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_8_BpfRand__apply;
  __pyx_type_4bpf4_4core__BpfRand.tp_base = __pyx_ptype_4bpf4_4core__BpfUnaryOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfRand) < 0) __PYX_ERR(0, 4499, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfRand.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfRand.tp_dictoffset && __pyx_type_4bpf4_4core__BpfRand.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfRand.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfRand.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfRand) < 0) __PYX_ERR(0, 4499, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfRand, (PyObject *)&__pyx_type_4bpf4_4core__BpfRand) < 0) __PYX_ERR(0, 4499, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfRand = &__pyx_type_4bpf4_4core__BpfRand;
  __pyx_vtabptr_4bpf4_4core__BpfM2F = &__pyx_vtable_4bpf4_4core__BpfM2F;
  __pyx_vtable_4bpf4_4core__BpfM2F.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfUnaryOp;
  __pyx_vtable_4bpf4_4core__BpfM2F.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_7_BpfM2F__apply;
  __pyx_type_4bpf4_4core__BpfM2F.tp_base = __pyx_ptype_4bpf4_4core__BpfUnaryOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfM2F) < 0) __PYX_ERR(0, 4506, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfM2F.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfM2F.tp_dictoffset && __pyx_type_4bpf4_4core__BpfM2F.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfM2F.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfM2F.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfM2F) < 0) __PYX_ERR(0, 4506, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfM2F, (PyObject *)&__pyx_type_4bpf4_4core__BpfM2F) < 0) __PYX_ERR(0, 4506, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfM2F = &__pyx_type_4bpf4_4core__BpfM2F;
  __pyx_vtabptr_4bpf4_4core__BpfF2M = &__pyx_vtable_4bpf4_4core__BpfF2M;
  __pyx_vtable_4bpf4_4core__BpfF2M.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfUnaryOp;
  __pyx_vtable_4bpf4_4core__BpfF2M.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_7_BpfF2M__apply;
  __pyx_type_4bpf4_4core__BpfF2M.tp_base = __pyx_ptype_4bpf4_4core__BpfUnaryOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfF2M) < 0) __PYX_ERR(0, 4512, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfF2M.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfF2M.tp_dictoffset && __pyx_type_4bpf4_4core__BpfF2M.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfF2M.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfF2M.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfF2M) < 0) __PYX_ERR(0, 4512, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfF2M, (PyObject *)&__pyx_type_4bpf4_4core__BpfF2M) < 0) __PYX_ERR(0, 4512, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfF2M = &__pyx_type_4bpf4_4core__BpfF2M;
  __pyx_vtabptr_4bpf4_4core__Bpf_db2amp = &__pyx_vtable_4bpf4_4core__Bpf_db2amp;
  __pyx_vtable_4bpf4_4core__Bpf_db2amp.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfUnaryOp;
  __pyx_vtable_4bpf4_4core__Bpf_db2amp.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_11_Bpf_db2amp__apply;
  __pyx_type_4bpf4_4core__Bpf_db2amp.tp_base = __pyx_ptype_4bpf4_4core__BpfUnaryOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__Bpf_db2amp) < 0) __PYX_ERR(0, 4518, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__Bpf_db2amp.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__Bpf_db2amp.tp_dictoffset && __pyx_type_4bpf4_4core__Bpf_db2amp.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__Bpf_db2amp.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__Bpf_db2amp.tp_dict, __pyx_vtabptr_4bpf4_4core__Bpf_db2amp) < 0) __PYX_ERR(0, 4518, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Bpf_db2amp, (PyObject *)&__pyx_type_4bpf4_4core__Bpf_db2amp) < 0) __PYX_ERR(0, 4518, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__Bpf_db2amp = &__pyx_type_4bpf4_4core__Bpf_db2amp;
  __pyx_vtabptr_4bpf4_4core__Bpf_amp2db = &__pyx_vtable_4bpf4_4core__Bpf_amp2db;
  __pyx_vtable_4bpf4_4core__Bpf_amp2db.__pyx_base = *__pyx_vtabptr_4bpf4_4core__BpfUnaryOp;
  __pyx_vtable_4bpf4_4core__Bpf_amp2db.__pyx_base._apply = (void (*)(struct __pyx_obj_4bpf4_4core__BpfUnaryOp *, __pyx_t_4bpf4_4core_DTYPE_t *, int))__pyx_f_4bpf4_4core_11_Bpf_amp2db__apply;
  __pyx_type_4bpf4_4core__Bpf_amp2db.tp_base = __pyx_ptype_4bpf4_4core__BpfUnaryOp;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__Bpf_amp2db) < 0) __PYX_ERR(0, 4524, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__Bpf_amp2db.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__Bpf_amp2db.tp_dictoffset && __pyx_type_4bpf4_4core__Bpf_amp2db.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__Bpf_amp2db.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__Bpf_amp2db.tp_dict, __pyx_vtabptr_4bpf4_4core__Bpf_amp2db) < 0) __PYX_ERR(0, 4524, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Bpf_amp2db, (PyObject *)&__pyx_type_4bpf4_4core__Bpf_amp2db) < 0) __PYX_ERR(0, 4524, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__Bpf_amp2db = &__pyx_type_4bpf4_4core__Bpf_amp2db;
  __pyx_vtabptr_4bpf4_4core__BpfLambdaClip = &__pyx_vtable_4bpf4_4core__BpfLambdaClip;
  __pyx_vtable_4bpf4_4core__BpfLambdaClip.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfLambdaClip.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_14_BpfLambdaClip_mapn_between;
  __pyx_vtable_4bpf4_4core__BpfLambdaClip.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_14_BpfLambdaClip___ccall__;
  __pyx_type_4bpf4_4core__BpfLambdaClip.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfLambdaClip) < 0) __PYX_ERR(0, 4532, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfLambdaClip.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfLambdaClip.tp_dictoffset && __pyx_type_4bpf4_4core__BpfLambdaClip.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfLambdaClip.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfLambdaClip.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfLambdaClip) < 0) __PYX_ERR(0, 4532, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfLambdaClip, (PyObject *)&__pyx_type_4bpf4_4core__BpfLambdaClip) < 0) __PYX_ERR(0, 4532, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfLambdaClip = &__pyx_type_4bpf4_4core__BpfLambdaClip;
  __pyx_vtabptr_4bpf4_4core__BpfDeriv = &__pyx_vtable_4bpf4_4core__BpfDeriv;
  __pyx_vtable_4bpf4_4core__BpfDeriv.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfDeriv.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_9_BpfDeriv___ccall__;
  __pyx_type_4bpf4_4core__BpfDeriv.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfDeriv) < 0) __PYX_ERR(0, 4595, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfDeriv.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfDeriv.tp_dictoffset && __pyx_type_4bpf4_4core__BpfDeriv.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfDeriv.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core__BpfDeriv, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 4595, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_9_BpfDeriv___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_9_BpfDeriv___init__.doc = __pyx_doc_4bpf4_4core_9_BpfDeriv___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_9_BpfDeriv___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfDeriv.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfDeriv) < 0) __PYX_ERR(0, 4595, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfDeriv, (PyObject *)&__pyx_type_4bpf4_4core__BpfDeriv) < 0) __PYX_ERR(0, 4595, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfDeriv = &__pyx_type_4bpf4_4core__BpfDeriv;
  __pyx_vtabptr_4bpf4_4core__BpfInverted = &__pyx_vtable_4bpf4_4core__BpfInverted;
  __pyx_vtable_4bpf4_4core__BpfInverted.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfInverted.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_12_BpfInverted___ccall__;
  __pyx_type_4bpf4_4core__BpfInverted.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfInverted) < 0) __PYX_ERR(0, 4634, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfInverted.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfInverted.tp_dictoffset && __pyx_type_4bpf4_4core__BpfInverted.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfInverted.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfInverted.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfInverted) < 0) __PYX_ERR(0, 4634, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfInverted, (PyObject *)&__pyx_type_4bpf4_4core__BpfInverted) < 0) __PYX_ERR(0, 4634, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfInverted = &__pyx_type_4bpf4_4core__BpfInverted;
  __pyx_vtabptr_4bpf4_4core__BpfIntegrate = &__pyx_vtable_4bpf4_4core__BpfIntegrate;
  __pyx_vtable_4bpf4_4core__BpfIntegrate.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfIntegrate.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_13_BpfIntegrate_mapn_between;
  __pyx_vtable_4bpf4_4core__BpfIntegrate.__pyx_base.derivative = (struct __pyx_obj_4bpf4_4core_BpfInterface *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_13_BpfIntegrate_derivative;
  __pyx_vtable_4bpf4_4core__BpfIntegrate.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_13_BpfIntegrate___ccall__;
  __pyx_vtable_4bpf4_4core__BpfIntegrate.get_integration_steps = (int (*)(struct __pyx_obj_4bpf4_4core__BpfIntegrate *, double))__pyx_f_4bpf4_4core_13_BpfIntegrate_get_integration_steps;
  __pyx_type_4bpf4_4core__BpfIntegrate.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfIntegrate) < 0) __PYX_ERR(0, 4663, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfIntegrate.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfIntegrate.tp_dictoffset && __pyx_type_4bpf4_4core__BpfIntegrate.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfIntegrate.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core__BpfIntegrate, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 4663, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_13_BpfIntegrate___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_13_BpfIntegrate___init__.doc = __pyx_doc_4bpf4_4core_13_BpfIntegrate___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_13_BpfIntegrate___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfIntegrate.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfIntegrate) < 0) __PYX_ERR(0, 4663, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfIntegrate, (PyObject *)&__pyx_type_4bpf4_4core__BpfIntegrate) < 0) __PYX_ERR(0, 4663, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfIntegrate = &__pyx_type_4bpf4_4core__BpfIntegrate;
  __pyx_vtabptr_4bpf4_4core__BpfPeriodic = &__pyx_vtable_4bpf4_4core__BpfPeriodic;
  __pyx_vtable_4bpf4_4core__BpfPeriodic.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfPeriodic.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_12_BpfPeriodic___ccall__;
  __pyx_type_4bpf4_4core__BpfPeriodic.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfPeriodic) < 0) __PYX_ERR(0, 4748, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfPeriodic.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfPeriodic.tp_dictoffset && __pyx_type_4bpf4_4core__BpfPeriodic.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfPeriodic.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfPeriodic.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfPeriodic) < 0) __PYX_ERR(0, 4748, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfPeriodic, (PyObject *)&__pyx_type_4bpf4_4core__BpfPeriodic) < 0) __PYX_ERR(0, 4748, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfPeriodic = &__pyx_type_4bpf4_4core__BpfPeriodic;
  __pyx_vtabptr_4bpf4_4core__BpfProjection = &__pyx_vtable_4bpf4_4core__BpfProjection;
  __pyx_vtable_4bpf4_4core__BpfProjection.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfProjection.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_14_BpfProjection___ccall__;
  __pyx_type_4bpf4_4core__BpfProjection.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfProjection) < 0) __PYX_ERR(0, 4772, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfProjection.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfProjection.tp_dictoffset && __pyx_type_4bpf4_4core__BpfProjection.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfProjection.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core__BpfProjection, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 4772, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_14_BpfProjection___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_14_BpfProjection___init__.doc = __pyx_doc_4bpf4_4core_14_BpfProjection___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_14_BpfProjection___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfProjection.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfProjection) < 0) __PYX_ERR(0, 4772, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfProjection, (PyObject *)&__pyx_type_4bpf4_4core__BpfProjection) < 0) __PYX_ERR(0, 4772, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfProjection = &__pyx_type_4bpf4_4core__BpfProjection;
  __pyx_vtabptr_4bpf4_4core__BpfKeepSlope = &__pyx_vtable_4bpf4_4core__BpfKeepSlope;
  __pyx_vtable_4bpf4_4core__BpfKeepSlope.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfKeepSlope.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_13_BpfKeepSlope___ccall__;
  __pyx_type_4bpf4_4core__BpfKeepSlope.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfKeepSlope) < 0) __PYX_ERR(0, 4830, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfKeepSlope.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfKeepSlope.tp_dictoffset && __pyx_type_4bpf4_4core__BpfKeepSlope.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfKeepSlope.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfKeepSlope.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfKeepSlope) < 0) __PYX_ERR(0, 4830, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfKeepSlope, (PyObject *)&__pyx_type_4bpf4_4core__BpfKeepSlope) < 0) __PYX_ERR(0, 4830, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfKeepSlope = &__pyx_type_4bpf4_4core__BpfKeepSlope;
  __pyx_vtabptr_4bpf4_4core__BpfCrop = &__pyx_vtable_4bpf4_4core__BpfCrop;
  __pyx_vtable_4bpf4_4core__BpfCrop.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__BpfCrop.__pyx_base.mapn_between = (PyArrayObject *(*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, int, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_mapn_between *__pyx_optional_args))__pyx_f_4bpf4_4core_8_BpfCrop_mapn_between;
  __pyx_vtable_4bpf4_4core__BpfCrop.__pyx_base.integrate_between = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double, double, int __pyx_skip_dispatch, struct __pyx_opt_args_4bpf4_4core_12BpfInterface_integrate_between *__pyx_optional_args))__pyx_f_4bpf4_4core_8_BpfCrop_integrate_between;
  __pyx_vtable_4bpf4_4core__BpfCrop.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_8_BpfCrop___ccall__;
  __pyx_vtable_4bpf4_4core__BpfCrop.outbound_set = (struct __pyx_obj_4bpf4_4core__BpfCrop *(*)(struct __pyx_obj_4bpf4_4core__BpfCrop *, double, double, int __pyx_skip_dispatch))__pyx_f_4bpf4_4core_8_BpfCrop_outbound_set;
  __pyx_type_4bpf4_4core__BpfCrop.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfCrop) < 0) __PYX_ERR(0, 4857, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfCrop.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfCrop.tp_dictoffset && __pyx_type_4bpf4_4core__BpfCrop.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfCrop.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfCrop.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfCrop) < 0) __PYX_ERR(0, 4857, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfCrop, (PyObject *)&__pyx_type_4bpf4_4core__BpfCrop) < 0) __PYX_ERR(0, 4857, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfCrop = &__pyx_type_4bpf4_4core__BpfCrop;
  __pyx_vtabptr_4bpf4_4core__MultipleBpfs = &__pyx_vtable_4bpf4_4core__MultipleBpfs;
  __pyx_vtable_4bpf4_4core__MultipleBpfs.__pyx_base = *__pyx_vtabptr_4bpf4_4core_BpfInterface;
  __pyx_vtable_4bpf4_4core__MultipleBpfs.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_13_MultipleBpfs___ccall__;
  __pyx_type_4bpf4_4core__MultipleBpfs.tp_base = __pyx_ptype_4bpf4_4core_BpfInterface;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__MultipleBpfs) < 0) __PYX_ERR(0, 4994, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__MultipleBpfs.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__MultipleBpfs.tp_dictoffset && __pyx_type_4bpf4_4core__MultipleBpfs.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__MultipleBpfs.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__MultipleBpfs.tp_dict, __pyx_vtabptr_4bpf4_4core__MultipleBpfs) < 0) __PYX_ERR(0, 4994, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MultipleBpfs, (PyObject *)&__pyx_type_4bpf4_4core__MultipleBpfs) < 0) __PYX_ERR(0, 4994, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__MultipleBpfs = &__pyx_type_4bpf4_4core__MultipleBpfs;
  __pyx_vtabptr_4bpf4_4core_Max = &__pyx_vtable_4bpf4_4core_Max;
  __pyx_vtable_4bpf4_4core_Max.__pyx_base = *__pyx_vtabptr_4bpf4_4core__MultipleBpfs;
  __pyx_vtable_4bpf4_4core_Max.__pyx_base.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_3Max___ccall__;
  __pyx_type_4bpf4_4core_Max.tp_base = __pyx_ptype_4bpf4_4core__MultipleBpfs;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Max) < 0) __PYX_ERR(0, 5030, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Max.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Max.tp_dictoffset && __pyx_type_4bpf4_4core_Max.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Max.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Max.tp_dict, __pyx_vtabptr_4bpf4_4core_Max) < 0) __PYX_ERR(0, 5030, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Max, (PyObject *)&__pyx_type_4bpf4_4core_Max) < 0) __PYX_ERR(0, 5030, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Max = &__pyx_type_4bpf4_4core_Max;
  __pyx_vtabptr_4bpf4_4core_Min = &__pyx_vtable_4bpf4_4core_Min;
  __pyx_vtable_4bpf4_4core_Min.__pyx_base = *__pyx_vtabptr_4bpf4_4core__MultipleBpfs;
  __pyx_vtable_4bpf4_4core_Min.__pyx_base.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_3Min___ccall__;
  __pyx_type_4bpf4_4core_Min.tp_base = __pyx_ptype_4bpf4_4core__MultipleBpfs;
  if (PyType_Ready(&__pyx_type_4bpf4_4core_Min) < 0) __PYX_ERR(0, 5061, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core_Min.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core_Min.tp_dictoffset && __pyx_type_4bpf4_4core_Min.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core_Min.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core_Min.tp_dict, __pyx_vtabptr_4bpf4_4core_Min) < 0) __PYX_ERR(0, 5061, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Min, (PyObject *)&__pyx_type_4bpf4_4core_Min) < 0) __PYX_ERR(0, 5061, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core_Min = &__pyx_type_4bpf4_4core_Min;
  __pyx_vtabptr_4bpf4_4core__BpfSelect = &__pyx_vtable_4bpf4_4core__BpfSelect;
  __pyx_vtable_4bpf4_4core__BpfSelect.__pyx_base = *__pyx_vtabptr_4bpf4_4core__MultipleBpfs;
  __pyx_vtable_4bpf4_4core__BpfSelect.__pyx_base.__pyx_base.__pyx___ccall__ = (double (*)(struct __pyx_obj_4bpf4_4core_BpfInterface *, double))__pyx_f_4bpf4_4core_10_BpfSelect___ccall__;
  __pyx_type_4bpf4_4core__BpfSelect.tp_base = __pyx_ptype_4bpf4_4core__MultipleBpfs;
  if (PyType_Ready(&__pyx_type_4bpf4_4core__BpfSelect) < 0) __PYX_ERR(0, 5093, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core__BpfSelect.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core__BpfSelect.tp_dictoffset && __pyx_type_4bpf4_4core__BpfSelect.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core__BpfSelect.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4bpf4_4core__BpfSelect, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 5093, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_4bpf4_4core_10_BpfSelect___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_4bpf4_4core_10_BpfSelect___init__.doc = __pyx_doc_4bpf4_4core_10_BpfSelect___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4bpf4_4core_10_BpfSelect___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_4bpf4_4core__BpfSelect.tp_dict, __pyx_vtabptr_4bpf4_4core__BpfSelect) < 0) __PYX_ERR(0, 5093, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BpfSelect, (PyObject *)&__pyx_type_4bpf4_4core__BpfSelect) < 0) __PYX_ERR(0, 5093, __pyx_L1_error)
  __pyx_ptype_4bpf4_4core__BpfSelect = &__pyx_type_4bpf4_4core__BpfSelect;
  if (PyType_Ready(&__pyx_type_4bpf4_4core___pyx_scope_struct__segments) < 0) __PYX_ERR(0, 2333, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core___pyx_scope_struct__segments.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core___pyx_scope_struct__segments.tp_dictoffset && __pyx_type_4bpf4_4core___pyx_scope_struct__segments.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core___pyx_scope_struct__segments.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_4bpf4_4core___pyx_scope_struct__segments = &__pyx_type_4bpf4_4core___pyx_scope_struct__segments;
  if (PyType_Ready(&__pyx_type_4bpf4_4core___pyx_scope_struct_1_segments) < 0) __PYX_ERR(0, 3074, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core___pyx_scope_struct_1_segments.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core___pyx_scope_struct_1_segments.tp_dictoffset && __pyx_type_4bpf4_4core___pyx_scope_struct_1_segments.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core___pyx_scope_struct_1_segments.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_4bpf4_4core___pyx_scope_struct_1_segments = &__pyx_type_4bpf4_4core___pyx_scope_struct_1_segments;
  if (PyType_Ready(&__pyx_type_4bpf4_4core___pyx_scope_struct_2_segments) < 0) __PYX_ERR(0, 3269, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core___pyx_scope_struct_2_segments.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core___pyx_scope_struct_2_segments.tp_dictoffset && __pyx_type_4bpf4_4core___pyx_scope_struct_2_segments.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core___pyx_scope_struct_2_segments.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_4bpf4_4core___pyx_scope_struct_2_segments = &__pyx_type_4bpf4_4core___pyx_scope_struct_2_segments;
  if (PyType_Ready(&__pyx_type_4bpf4_4core___pyx_scope_struct_3_segments) < 0) __PYX_ERR(0, 3370, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core___pyx_scope_struct_3_segments.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core___pyx_scope_struct_3_segments.tp_dictoffset && __pyx_type_4bpf4_4core___pyx_scope_struct_3_segments.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core___pyx_scope_struct_3_segments.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_4bpf4_4core___pyx_scope_struct_3_segments = &__pyx_type_4bpf4_4core___pyx_scope_struct_3_segments;
  if (PyType_Ready(&__pyx_type_4bpf4_4core___pyx_scope_struct_4_segments) < 0) __PYX_ERR(0, 3800, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_4bpf4_4core___pyx_scope_struct_4_segments.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4bpf4_4core___pyx_scope_struct_4_segments.tp_dictoffset && __pyx_type_4bpf4_4core___pyx_scope_struct_4_segments.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_4bpf4_4core___pyx_scope_struct_4_segments.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_4bpf4_4core___pyx_scope_struct_4_segments = &__pyx_type_4bpf4_4core___pyx_scope_struct_4_segments;
  if (PyType_Ready(&__pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py) < 0) __PYX_ERR(2, 64, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py.tp_dictoffset && __pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype___pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py = &__pyx_scope_struct____Pyx_CFunc_double____double____nogil_to_py;
  __pyx_vtabptr_array = &__pyx_vtable_array;
  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type___pyx_array.tp_print = 0;
  #endif
  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
  __pyx_array_type = &__pyx_type___pyx_array;
  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type___pyx_MemviewEnum.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type___pyx_memoryview.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type___pyx_memoryviewslice.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(4, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(5, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
   if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initcore(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initcore(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_core(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_core(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_core(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  unsigned int __pyx_t_4;
  double __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  static __pyx_t_4bpf4_4core_t_unfunc __pyx_t_7[14];
  static PyThread_type_lock __pyx_t_8[8];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'core' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_core(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("core", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_bpf4__core) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "bpf4.core")) {
      if (unlikely(PyDict_SetItemString(modules, "bpf4.core", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "bpf4/core.pyx":71
 * # ---------------------------- import std-lib
 * # import math
 * import sys             # <<<<<<<<<<<<<<
 * import random
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":72
 * # import math
 * import sys
 * import random             # <<<<<<<<<<<<<<
 * 
 * # ---------------------------- import others
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_1) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":75
 * 
 * # ---------------------------- import others
 * import numpy             # <<<<<<<<<<<<<<
 * from numpy import array
 * from . import arraytools
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":76
 * # ---------------------------- import others
 * import numpy
 * from numpy import array             # <<<<<<<<<<<<<<
 * from . import arraytools
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_array);
  __Pyx_GIVEREF(__pyx_n_s_array);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_array);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_1) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bpf4/core.pyx":77
 * import numpy
 * from numpy import array
 * from . import arraytools             # <<<<<<<<<<<<<<
 * 
 * # ---------------------------- own imports
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_arraytools);
  __Pyx_GIVEREF(__pyx_n_s_arraytools);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_arraytools);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s__6, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_arraytools); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_arraytools, __pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":80
 * 
 * # ---------------------------- own imports
 * from .config import CONFIG             # <<<<<<<<<<<<<<
 * 
 * # ---------------------------- init
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_CONFIG);
  __Pyx_GIVEREF(__pyx_n_s_CONFIG);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_CONFIG);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_config, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CONFIG); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONFIG, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bpf4/core.pyx":83
 * 
 * # ---------------------------- init
 * import_array()             # <<<<<<<<<<<<<<
 * srand(random.randint(0, 99999))
 * 
 */
  __pyx_t_3 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 83, __pyx_L1_error)

  /* "bpf4/core.pyx":84
 * # ---------------------------- init
 * import_array()
 * srand(random.randint(0, 99999))             # <<<<<<<<<<<<<<
 * 
 * # ---------------------------- platform specific constants
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_randint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  srand(__pyx_t_4);

  /* "bpf4/core.pyx":88
 * # ---------------------------- platform specific constants
 * 
 * cdef double EPS = sys.float_info.epsilon             # <<<<<<<<<<<<<<
 * cdef double SQRT_EPS = sqrt(EPS)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_epsilon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_4bpf4_4core_EPS = __pyx_t_5;

  /* "bpf4/core.pyx":89
 * 
 * cdef double EPS = sys.float_info.epsilon
 * cdef double SQRT_EPS = sqrt(EPS)             # <<<<<<<<<<<<<<
 * 
 * # ---------------------------- DEFs
 */
  __pyx_v_4bpf4_4core_SQRT_EPS = sqrt(__pyx_v_4bpf4_4core_EPS);

  /* "bpf4/core.pyx":105
 * #       ERROR TYPES
 * # -------------------------------------------------------------------
 * class BpfPointsError(ValueError): pass             # <<<<<<<<<<<<<<
 * class BpfInversionError(ValueError): pass
 * 
 */
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__60); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__60, __pyx_n_s_BpfPointsError, __pyx_n_s_BpfPointsError, (PyObject *) NULL, __pyx_n_s_bpf4_core, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_BpfPointsError, __pyx_tuple__60, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BpfPointsError, __pyx_t_6) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bpf4/core.pyx":106
 * # -------------------------------------------------------------------
 * class BpfPointsError(ValueError): pass
 * class BpfInversionError(ValueError): pass             # <<<<<<<<<<<<<<
 * 
 * # -------------------------------------------------------------------
 */
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__61); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__61, __pyx_n_s_BpfInversionError, __pyx_n_s_BpfInversionError, (PyObject *) NULL, __pyx_n_s_bpf4_core, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_BpfInversionError, __pyx_tuple__61, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BpfInversionError, __pyx_t_6) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bpf4/core.pyx":353
 *     return <size_t>round((x1-x0)/dx+1)
 * 
 * cdef double _a4 = 442.0             # <<<<<<<<<<<<<<
 * DEF loge_2 = 0.6931471805599453094172321214581766
 * 
 */
  __pyx_v_4bpf4_4core__a4 = 442.0;

  /* "bpf4/core.pyx":357
 * 
 * 
 * def setA4(double freq):             # <<<<<<<<<<<<<<
 *     """
 *     Set the reference freq used
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_1setA4, 0, __pyx_n_s_setA4, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setA4, __pyx_t_2) < 0) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bpf4/core.pyx":386
 * 
 * cdef t_unfunc UNFUNCS[14]
 * UNFUNCS[:] = [             # <<<<<<<<<<<<<<
 *     cos,    # 0
 *     sin,    # 1
 */
  __pyx_t_7[0] = cos;
  __pyx_t_7[1] = sin;
  __pyx_t_7[2] = ceil;
  __pyx_t_7[3] = log;
  __pyx_t_7[4] = exp;
  __pyx_t_7[5] = floor;
  __pyx_t_7[6] = tanh;
  __pyx_t_7[7] = fabs;
  __pyx_t_7[8] = sqrt;
  __pyx_t_7[9] = acos;
  __pyx_t_7[10] = asin;
  __pyx_t_7[11] = tan;
  __pyx_t_7[12] = sinh;
  __pyx_t_7[13] = log10;
  memcpy(&(__pyx_v_4bpf4_4core_UNFUNCS[0]), __pyx_t_7, sizeof(__pyx_v_4bpf4_4core_UNFUNCS[0]) * (14));

  /* "bpf4/core.pyx":417
 *     unsigned int needs_free
 * 
 * DTYPE = numpy.float #np.float64             # <<<<<<<<<<<<<<
 * ctypedef c_numpy.float_t DTYPE_t
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_1) < 0) __PYX_ERR(0, 417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":501
 * 
 * # create the most used interpolation functions, which are shared across BPFs
 * cdef InterpolFunc* InterpolFunc_linear    = InterpolFunc_new(intrp_linear, 1.0, 'linear',  0)             # <<<<<<<<<<<<<<
 * cdef InterpolFunc* InterpolFunc_halfcos    = InterpolFunc_new(intrp_halfcos, 1.0, 'halfcos', 0)
 * cdef InterpolFunc* InterpolFunc_nointerpol = InterpolFunc_new(intrp_nointerpol,  1.0, 'nointerpol',  0)
 */
  __pyx_v_4bpf4_4core_InterpolFunc_linear = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_linear, 1.0, ((char *)"linear"), 0);

  /* "bpf4/core.pyx":502
 * # create the most used interpolation functions, which are shared across BPFs
 * cdef InterpolFunc* InterpolFunc_linear    = InterpolFunc_new(intrp_linear, 1.0, 'linear',  0)
 * cdef InterpolFunc* InterpolFunc_halfcos    = InterpolFunc_new(intrp_halfcos, 1.0, 'halfcos', 0)             # <<<<<<<<<<<<<<
 * cdef InterpolFunc* InterpolFunc_nointerpol = InterpolFunc_new(intrp_nointerpol,  1.0, 'nointerpol',  0)
 * cdef InterpolFunc* InterpolFunc_nearest   = InterpolFunc_new(intrp_nearest,  1.0, 'nearest',  0)
 */
  __pyx_v_4bpf4_4core_InterpolFunc_halfcos = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_halfcos, 1.0, ((char *)"halfcos"), 0);

  /* "bpf4/core.pyx":503
 * cdef InterpolFunc* InterpolFunc_linear    = InterpolFunc_new(intrp_linear, 1.0, 'linear',  0)
 * cdef InterpolFunc* InterpolFunc_halfcos    = InterpolFunc_new(intrp_halfcos, 1.0, 'halfcos', 0)
 * cdef InterpolFunc* InterpolFunc_nointerpol = InterpolFunc_new(intrp_nointerpol,  1.0, 'nointerpol',  0)             # <<<<<<<<<<<<<<
 * cdef InterpolFunc* InterpolFunc_nearest   = InterpolFunc_new(intrp_nearest,  1.0, 'nearest',  0)
 * cdef InterpolFunc* InterpolFunc_smooth    = InterpolFunc_new(intrp_smooth, 1.0, 'smooth', 0)
 */
  __pyx_v_4bpf4_4core_InterpolFunc_nointerpol = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_nointerpol, 1.0, ((char *)"nointerpol"), 0);

  /* "bpf4/core.pyx":504
 * cdef InterpolFunc* InterpolFunc_halfcos    = InterpolFunc_new(intrp_halfcos, 1.0, 'halfcos', 0)
 * cdef InterpolFunc* InterpolFunc_nointerpol = InterpolFunc_new(intrp_nointerpol,  1.0, 'nointerpol',  0)
 * cdef InterpolFunc* InterpolFunc_nearest   = InterpolFunc_new(intrp_nearest,  1.0, 'nearest',  0)             # <<<<<<<<<<<<<<
 * cdef InterpolFunc* InterpolFunc_smooth    = InterpolFunc_new(intrp_smooth, 1.0, 'smooth', 0)
 * cdef InterpolFunc* InterpolFunc_smoother  = InterpolFunc_new(intrp_smoother, 1.0, 'smoother', 0)
 */
  __pyx_v_4bpf4_4core_InterpolFunc_nearest = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_nearest, 1.0, ((char *)"nearest"), 0);

  /* "bpf4/core.pyx":505
 * cdef InterpolFunc* InterpolFunc_nointerpol = InterpolFunc_new(intrp_nointerpol,  1.0, 'nointerpol',  0)
 * cdef InterpolFunc* InterpolFunc_nearest   = InterpolFunc_new(intrp_nearest,  1.0, 'nearest',  0)
 * cdef InterpolFunc* InterpolFunc_smooth    = InterpolFunc_new(intrp_smooth, 1.0, 'smooth', 0)             # <<<<<<<<<<<<<<
 * cdef InterpolFunc* InterpolFunc_smoother  = InterpolFunc_new(intrp_smoother, 1.0, 'smoother', 0)
 * 
 */
  __pyx_v_4bpf4_4core_InterpolFunc_smooth = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_smooth, 1.0, ((char *)"smooth"), 0);

  /* "bpf4/core.pyx":506
 * cdef InterpolFunc* InterpolFunc_nearest   = InterpolFunc_new(intrp_nearest,  1.0, 'nearest',  0)
 * cdef InterpolFunc* InterpolFunc_smooth    = InterpolFunc_new(intrp_smooth, 1.0, 'smooth', 0)
 * cdef InterpolFunc* InterpolFunc_smoother  = InterpolFunc_new(intrp_smoother, 1.0, 'smoother', 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_4bpf4_4core_InterpolFunc_smoother = __pyx_f_4bpf4_4core_InterpolFunc_new(__pyx_f_4bpf4_4core_intrp_smoother, 1.0, ((char *)"smoother"), 0);

  /* "bpf4/core.pyx":517
 * DEF INF = float('inf')
 * DEF INFNEG = float('-inf')
 * cdef double MAX_FLOAT = 3.40282346638528860e+38             # <<<<<<<<<<<<<<
 * CONST_XS_FOR_RENDERING = numpy.linspace(0., 1., NUM_XS_FOR_RENDERING)
 * DEF NOCOPY = False
 */
  __pyx_v_4bpf4_4core_MAX_FLOAT = 3.40282346638528860e+38;

  /* "bpf4/core.pyx":518
 * DEF INFNEG = float('-inf')
 * cdef double MAX_FLOAT = 3.40282346638528860e+38
 * CONST_XS_FOR_RENDERING = numpy.linspace(0., 1., NUM_XS_FOR_RENDERING)             # <<<<<<<<<<<<<<
 * DEF NOCOPY = False
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_linspace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONST_XS_FOR_RENDERING, __pyx_t_1) < 0) __PYX_ERR(0, 518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":528
 * 
 * 
 * cpdef int _array_issorted(double[:] xs):             # <<<<<<<<<<<<<<
 *     """
 *     Is this array sorted?
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_3_array_issorted, 0, __pyx_n_s_array_issorted, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_issorted, __pyx_t_1) < 0) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":642
 *     return out
 * 
 * def _get_bounds(a, b):             # <<<<<<<<<<<<<<
 *     cdef double start, end, b_start, b_end
 *     start, end = a.bounds()
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_5_get_bounds, 0, __pyx_n_s_get_bounds, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_bounds, __pyx_t_1) < 0) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":668
 *     cdef double _x0, _x1
 *     cdef int _integration_mode  # 0: dont use scipy, 1: use scipy, -1: calibrate
 *     cpdef BpfInterface _asbpf(self): return self             # <<<<<<<<<<<<<<
 *     cdef void _bounds_changed(self): pass
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_1_asbpf, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface__asbpf, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_asbpf, __pyx_t_1) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":679
 *         self._set_bounds(a._x0, a._x1)
 * 
 *     cpdef double ntodx(self, int N):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the sampling period `dx`
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_3ntodx, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_ntodx, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_ntodx, __pyx_t_1) < 0) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":695
 *         return (self._x1 - self._x0) / (N - 1)
 * 
 *     cpdef int dxton(self, double dx):             # <<<<<<<<<<<<<<
 *         """
 *         Split the bounds of this bpf according to a given sampling period *dx*
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_5dxton, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_dxton, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_dxton, __pyx_t_1) < 0) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":717
 *         return <int>(((self._x1 + dx) - self._x0) / dx)
 * 
 *     def bounds(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple (xstart, xend) representing the bounds of this bpf
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_7bounds, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_bounds, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_bounds, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":884
 *             return _create_lambda(self, other, _BpfLambdaGreaterOrEqualThan, _BpfLambdaGreaterOrEqualThanConst) # (self < other) == 0
 * 
 *     def _get_points_for_rendering(self, int n= -1):             # <<<<<<<<<<<<<<
 *         # BpfInterface
 *         if n == -1:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_37_get_points_for_rendering, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface__get_points_for_ren, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_get_points_for_rendering, __pyx_t_1) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":892
 *         return xs, ys
 * 
 *     def render(self, xs, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new bpf representing this bpf rendered at the given points
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_39render, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_render, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_render, __pyx_t_1) < 0) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":946
 *                 raise ValueError("interpolation %s not implemented" % interpolation)
 * 
 *     def plot(self, kind='line', int n=-1, show=True, axes=None, **keys):             # <<<<<<<<<<<<<<
 *         """
 *         Plot the bpf. Any key is passed to plot.plot_coords
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_41plot, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_plot, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_plot, __pyx_t_1) < 0) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":978
 *         plot.plot_coords(xs, ys, kind=kind, show=show, axes=axes, **keys)
 * 
 *     cpdef BpfInterface sampled(self, double dx, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Sample this bpf at a regular interval, returns a Sampled bpf
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_43sampled, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_sampled, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_sampled, __pyx_t_1) < 0) __PYX_ERR(0, 978, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1015
 *         return Sampled(ys, dx=dx, x0=self._x0, interpolation=interpolation)
 * 
 *     cpdef ndarray sample_between(self, double x0, double x1, double dx, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Sample this bpf at an interval of dx between x0 and x1
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_45sample_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_sample_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_sample_between, __pyx_t_1) < 0) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1049
 *         return self.mapn_between(n, x0, x1, out)
 * 
 *     cpdef BpfInterface sampled_between(self, double x0, double x1, double dx, interpolation='linear'):             # <<<<<<<<<<<<<<
 *         """
 *         Sample a portion of this bpf, returns a `Sampled` bpf
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_47sampled_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_sampled_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_sampled_between, __pyx_t_1) < 0) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1072
 *         return Sampled(ys, dx=dx, x0=x0, interpolation=interpolation)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate an array of `n` values representing this bpf between `x0` and `x1`
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_49mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_mapn_between, __pyx_t_1) < 0) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1106
 *         return numpy.asarray(result)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         The same as map(self, xs) but faster
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_51map, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_map, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_map, __pyx_t_1) < 0) __PYX_ERR(0, 1106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1147
 *         return numpy.asarray(result)
 * 
 *     cpdef BpfInterface concat(self, BpfInterface other):             # <<<<<<<<<<<<<<
 *         """
 *         Concatenate this bpf to other
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_53concat, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_concat, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_concat, __pyx_t_1) < 0) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1172
 *         return _BpfConcat2_new(self, other2, other2._x0)
 * 
 *     cpdef _BpfLambdaRound round(self):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf representing round(self(x))
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_55round, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_round, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_round, __pyx_t_1) < 0) __PYX_ERR(0, 1172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1181
 *         return _BpfLambdaRound(self)
 * 
 *     cpdef _BpfRand rand(self):             # <<<<<<<<<<<<<<
 *         """
 *         A bpf representing rand(self(x))
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_57rand, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_rand, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_rand, __pyx_t_1) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1190
 *         return _BpfRand(self)
 * 
 *     cpdef _BpfUnaryFunc cos(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the cosine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 0)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_59cos, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_cos, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_cos, __pyx_t_1) < 0) __PYX_ERR(0, 1190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1194
 *         return _BpfUnaryFunc_new_from_index(self, 0)
 * 
 *     cpdef _BpfUnaryFunc sin(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the sine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 1)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_61sin, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_sin, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_sin, __pyx_t_1) < 0) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1198
 *         return _BpfUnaryFunc_new_from_index(self, 1)
 * 
 *     cpdef _BpfUnaryFunc ceil(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the ceil of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 2)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_63ceil, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_ceil, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_ceil, __pyx_t_1) < 0) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1202
 *         return _BpfUnaryFunc_new_from_index(self, 2)
 * 
 *     cpdef _BpfUnaryFunc expon(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the exp operation with this bpf
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_65expon, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_expon, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_expon, __pyx_t_1) < 0) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1220
 *         return _BpfUnaryFunc_new_from_index(self, 4)
 * 
 *     cpdef _BpfUnaryFunc floor(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the floor of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 5)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_67floor, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_floor, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_floor, __pyx_t_1) < 0) __PYX_ERR(0, 1220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1224
 *         return _BpfUnaryFunc_new_from_index(self, 5)
 * 
 *     cpdef _BpfUnaryFunc tanh(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the tanh of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 6)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_69tanh, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_tanh, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_tanh, __pyx_t_1) < 0) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1228
 *         return _BpfUnaryFunc_new_from_index(self, 6)
 * 
 *     cpdef _BpfUnaryFunc abs(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the absolute value of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 7)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_71abs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_abs, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_abs, __pyx_t_1) < 0) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1232
 *         return _BpfUnaryFunc_new_from_index(self, 7)
 * 
 *     cpdef _BpfUnaryFunc sqrt(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the sqrt of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 8)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_73sqrt, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_sqrt, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_sqrt, __pyx_t_1) < 0) __PYX_ERR(0, 1232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1236
 *         return _BpfUnaryFunc_new_from_index(self, 8)
 * 
 *     cpdef _BpfUnaryFunc acos(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the arc cosine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 9)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_75acos, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_acos, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_acos, __pyx_t_1) < 0) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1240
 *         return _BpfUnaryFunc_new_from_index(self, 9)
 * 
 *     cpdef _BpfUnaryFunc asin(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the arc sine of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 10)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_77asin, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_asin, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_asin, __pyx_t_1) < 0) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1244
 *         return _BpfUnaryFunc_new_from_index(self, 10)
 * 
 *     cpdef _BpfUnaryFunc tan(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the tan of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 11)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_79tan, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_tan, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_tan, __pyx_t_1) < 0) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1248
 *         return _BpfUnaryFunc_new_from_index(self, 11)
 * 
 *     cpdef _BpfUnaryFunc sinh(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the sinh of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 12)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_81sinh, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_sinh, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_sinh, __pyx_t_1) < 0) __PYX_ERR(0, 1248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1252
 *         return _BpfUnaryFunc_new_from_index(self, 12)
 * 
 *     cpdef _BpfUnaryFunc log10(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf representing the log10 of this bpf"""
 *         return _BpfUnaryFunc_new_from_index(self, 13)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_83log10, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_log10, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_log10, __pyx_t_1) < 0) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1256
 *         return _BpfUnaryFunc_new_from_index(self, 13)
 * 
 *     cpdef _BpfLambdaLog log(self, double base=M_E):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing the log of this bpf
 */
  __pyx_k__7 = M_E;
  __pyx_k__7 = M_E;
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_85log, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_log, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_log, __pyx_t_1) < 0) __PYX_ERR(0, 1256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1269
 *         return _BpfLambdaLog(self, base, self.bounds())
 * 
 *     cpdef _BpfM2F m2f(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf converting from midinotes to frequency
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_87m2f, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_m2f, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_m2f, __pyx_t_1) < 0) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1289
 *         return _BpfM2F(self)
 * 
 *     cpdef _BpfF2M f2m(self):             # <<<<<<<<<<<<<<
 *         """Returns a bpf converting frequencies to midinotes
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_89f2m, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_f2m, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_f2m, __pyx_t_1) < 0) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1307
 *         return _BpfF2M(self)
 * 
 *     cpdef _Bpf_db2amp db2amp(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf converting decibels to linear amplitudes
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_91db2amp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_db2amp, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_db2amp, __pyx_t_1) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1324
 *         return _Bpf_db2amp(self)
 * 
 *     cpdef _Bpf_amp2db amp2db(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf converting linear amplitudes to decibels
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_93amp2db, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_amp2db, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_amp2db, __pyx_t_1) < 0) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1342
 *         return _Bpf_amp2db(self)
 * 
 *     cpdef _BpfLambdaClip clip(self, double y0=INFNEG, double y1=INF):             # <<<<<<<<<<<<<<
 *         """
 *         Return a bpf clipping the result between y0 and y1
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_95clip, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_clip, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_clip, __pyx_t_1) < 0) __PYX_ERR(0, 1342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1368
 *         return _BpfLambdaClip_new(self, y0, y1)
 * 
 *     cpdef BpfInterface derivative(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create a curve which represents the derivative of this curve
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_97derivative, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_derivative, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_derivative, __pyx_t_1) < 0) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1401
 *         return _BpfDeriv(self)
 * 
 *     cpdef BpfInterface integrated(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a bpf representing the integration of this bpf at a given point
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_99integrated, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_integrated, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_integrated, __pyx_t_1) < 0) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1428
 *         return _BpfIntegrate(self)
 * 
 *     cpdef double integrate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the result of the integration of this bpf.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_101integrate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_integrate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_integrate, __pyx_t_1) < 0) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1452
 *         return self.integrate_between(self._x0, self._x1)
 * 
 *     cpdef double trapz_integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between [x0, x1] using the trapt method
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_103trapz_integrate_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_trapz_integrate_bet, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_trapz_integrate_between, __pyx_t_1) < 0) __PYX_ERR(0, 1452, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1476
 *         return _integr_trapz(&ys[0], ys.shape[0], dx)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between x0 and x1
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_105integrate_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_integrate_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_integrate_between, __pyx_t_1) < 0) __PYX_ERR(0, 1476, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1512
 *         return outbound0 + inbound + outbound1
 * 
 *     cpdef double mean(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calculate the mean value of this bpf.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_107mean, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_mean, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_mean, __pyx_t_1) < 0) __PYX_ERR(0, 1512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1529
 *         return self.integrate() / (self._x1 - self._x0)
 * 
 *     cpdef list zeros(self, double h=0.01, int N=0, double x0=NAN, double x1=NAN, int maxzeros=0):             # <<<<<<<<<<<<<<
 *         """
 *         Find the zeros of this bpf
 */
  __pyx_k__9 = NAN;
  __pyx_k__10 = NAN;
  __pyx_k__9 = NAN;
  __pyx_k__10 = NAN;
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_109zeros, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_zeros, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_zeros, __pyx_t_1) < 0) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1560
 *         return bpf_zero_crossings(self, h=h, N=N, x0=x0, x1=x1, maxzeros=maxzeros)
 * 
 *     def max(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing `max(self, b)`
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_111max, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_max, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_max, __pyx_t_1) < 0) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1588
 *         return _BpfMaxConst(self, b, self.bounds())
 * 
 *     def min(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a bpf representing `min(self, b)`
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_113min, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_min, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_min, __pyx_t_1) < 0) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1615
 *         return _BpfMinConst(self, b, self.bounds())
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), self.__getstate__()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_115__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface___reduce, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_reduce, __pyx_t_1) < 0) __PYX_ERR(0, 1615, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1633
 *         return self.__ccall__(x)
 * 
 *     def keep_slope(self, double epsilon=DEFAULT_EPSILON):             # <<<<<<<<<<<<<<
 *         """
 *         A view of this bpf where the slope is continued outside its bounds
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_119keep_slope, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_keep_slope, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_keep_slope, __pyx_t_1) < 0) __PYX_ERR(0, 1633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1664
 *         return _BpfKeepSlope(self, epsilon)
 * 
 *     def outbound(self, double y0, double y1):             # <<<<<<<<<<<<<<
 *         """
 *         Return a new Bpf with the given values outside the bounds
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_121outbound, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_outbound, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_outbound, __pyx_t_1) < 0) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1691
 *         return _BpfCrop_new(self, self._x0, self._x1, OUTBOUND_SET, y0, y1)
 * 
 *     def apply(self, func):             # <<<<<<<<<<<<<<
 *         """
 *         Create a bpf where `func` is applied to the result of this pdf
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_123apply, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_apply, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_apply, __pyx_t_1) < 0) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1723
 *         return _BpfCompose_new(self, _FunctionWrap(func))
 * 
 *     def preapply(self, func):             # <<<<<<<<<<<<<<
 *         """
 *         Create a bpf where `func` is applied to the argument before it is passed
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_125preapply, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_preapply, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_preapply, __pyx_t_1) < 0) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1753
 *         return _BpfCompose_new(_FunctionWrap(func), self)
 * 
 *     def periodic(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create a new bpf which replicates this in a periodic way
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_127periodic, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_periodic, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_periodic, __pyx_t_1) < 0) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1777
 *         return _BpfPeriodic(self)
 * 
 *     def stretched(self, double rx, double fixpoint=0.):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a view of this bpf stretched over the x axis.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_129stretched, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_stretched, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_stretched, __pyx_t_1) < 0) __PYX_ERR(0, 1777, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1822
 *         return self.fit_between(p0, p1)
 * 
 *     cpdef BpfInterface fit_between(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a view of this bpf fitted within the interval `x0:x1`
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_131fit_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_fit_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_fit_between, __pyx_t_1) < 0) __PYX_ERR(0, 1822, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1861
 * 
 * 
 *     cpdef BpfInterface shifted(self, dx):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a view of this bpf shifted by `dx` over the x-axes
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_133shifted, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_shifted, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_shifted, __pyx_t_1) < 0) __PYX_ERR(0, 1861, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1879
 *         return _BpfProjection(self, rx=1, dx=-dx)
 * 
 *     def inverted(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view on this bpf with the coords inverted
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_135inverted, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_inverted, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_inverted, __pyx_t_1) < 0) __PYX_ERR(0, 1879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1905
 *             return None
 * 
 *     cpdef BpfInterface _slice(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         return _BpfCrop_new(self, x0, x1, OUTBOUND_DEFAULT, 0, 0)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_137_slice, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface__slice, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_slice, __pyx_t_1) < 0) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1925
 * 
 *     @classmethod
 *     def fromseq(cls, *points, **kws):             # <<<<<<<<<<<<<<
 *         """
 *         A helper constructor, in this variant points are given as tuples or as a flat sequence.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_141fromseq, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_fromseq, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_fromseq, __pyx_t_1) < 0) __PYX_ERR(0, 1925, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1924
 *             raise ValueError("BPFs accept only slices, not single items.")
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromseq(cls, *points, **kws):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface, __pyx_n_s_fromseq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_fromseq, __pyx_t_2) < 0) __PYX_ERR(0, 1925, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1968
 *                 return cls(points[::2], points[1::2], **kws)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create a copy of this bpf
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_143copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_copy, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 1968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":1984
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(x0), str(x1))
 * 
 *     def debug(self, key, value=None):             # <<<<<<<<<<<<<<
 *         """
 *         keys:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12BpfInterface_147debug, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInterface_debug, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfInterface->tp_dict, __pyx_n_s_debug, __pyx_t_2) < 0) __PYX_ERR(0, 1984, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfInterface);

  /* "bpf4/core.pyx":2088
 *             self.outbound1 = (<DTYPE_t *>(self.ys_data))[last_index]
 * 
 *     def outbound(self, double y0, double y1):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values **inplace** returned when this bpf is evaluated outside its bounds.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7BpfBase_7outbound, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBase_outbound, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase->tp_dict, __pyx_n_s_outbound, __pyx_t_2) < 0) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfBase);

  /* "bpf4/core.pyx":2101
 *         return self
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.xs, self.ys)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7BpfBase_9__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBase___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 2101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfBase);

  /* "bpf4/core.pyx":2104
 *         return (self.xs, self.ys)
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.xs, self.ys = state
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7BpfBase_11__setstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBase___setstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase->tp_dict, __pyx_n_s_setstate, __pyx_t_2) < 0) __PYX_ERR(0, 2104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfBase);

  /* "bpf4/core.pyx":2136
 *         return res
 * 
 *     cpdef ndarray mapn_between(self, int n, double xstart, double xend, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef double[::1] result = out if out is not None else EMPTY1D(n)
 *         cdef double dx = _ntodx(n, xstart, xend)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7BpfBase_13mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBase_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase->tp_dict, __pyx_n_s_mapn_between, __pyx_t_2) < 0) __PYX_ERR(0, 2136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfBase);

  /* "bpf4/core.pyx":2183
 *         return numpy.asarray(result)
 * 
 *     cpdef ndarray _mapn_between(self, int n, double xstart, double xend, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7BpfBase_15_mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBase__mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase->tp_dict, __pyx_n_s_mapn_between_2, __pyx_t_2) < 0) __PYX_ERR(0, 2183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfBase);

  /* "bpf4/core.pyx":2209
 *         return "%s[%s:%s]" % (self.__class__.__name__, str(self._x0), str(self._x1))
 * 
 *     def stretch(self, double rx):             # <<<<<<<<<<<<<<
 *         """
 *         Stretch or compress this bpf in the x-coordinate **INPLACE**
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7BpfBase_19stretch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBase_stretch, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase->tp_dict, __pyx_n_s_stretch, __pyx_t_2) < 0) __PYX_ERR(0, 2209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfBase);

  /* "bpf4/core.pyx":2224
 *         self._recalculate_bounds()
 * 
 *     def shift(self, double dx):             # <<<<<<<<<<<<<<
 *         """
 *         Shift the bpf along the x-coords, **INPLACE**
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7BpfBase_21shift, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBase_shift, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase->tp_dict, __pyx_n_s_shift, __pyx_t_2) < 0) __PYX_ERR(0, 2224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfBase);

  /* "bpf4/core.pyx":2246
 *         self._invalidate_cache()
 * 
 *     def points(BpfBase self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple with the points defining this bpf
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7BpfBase_23points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBase_points, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase->tp_dict, __pyx_n_s_points, __pyx_t_2) < 0) __PYX_ERR(0, 2246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfBase);

  /* "bpf4/core.pyx":2267
 *         return self.xs, self.ys
 * 
 *     def clone_with_new_data(self, xs: ndarray, ys: ndarray) -> BpfInterface:             # <<<<<<<<<<<<<<
 *         """
 *         Create a new bpf with the same attributes as self but with new data
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_xs, __pyx_n_u_ndarray) < 0) __PYX_ERR(0, 2267, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ys, __pyx_n_u_ndarray) < 0) __PYX_ERR(0, 2267, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_u_BpfInterface) < 0) __PYX_ERR(0, 2267, __pyx_L1_error)
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7BpfBase_25clone_with_new_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBase_clone_with_new_data, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_1, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase->tp_dict, __pyx_n_s_clone_with_new_data, __pyx_t_1) < 0) __PYX_ERR(0, 2267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfBase);

  /* "bpf4/core.pyx":2283
 *         return self.__class__(*newstate)
 * 
 *     def insertpoint(self, double x, double y):             # <<<<<<<<<<<<<<
 *         """
 *         Return **a copy** of this bpf with the point `(x, y)` inserted
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7BpfBase_27insertpoint, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBase_insertpoint, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase->tp_dict, __pyx_n_s_insertpoint, __pyx_t_1) < 0) __PYX_ERR(0, 2283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfBase);

  /* "bpf4/core.pyx":2303
 *         return self.clone_with_new_data(new_xs, new_ys)
 * 
 *     def removepoint(self, double x):             # <<<<<<<<<<<<<<
 *         """
 *         Return a copy of this bpf with point at x removed
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7BpfBase_29removepoint, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBase_removepoint, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase->tp_dict, __pyx_n_s_removepoint, __pyx_t_1) < 0) __PYX_ERR(0, 2303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfBase);

  /* "bpf4/core.pyx":2333
 *         return self.clone_with_new_data(newxs, newys)
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return an iterator over the segments of this bpf
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7BpfBase_31segments, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBase_segments, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_BpfBase->tp_dict, __pyx_n_s_segments, __pyx_t_1) < 0) __PYX_ERR(0, 2333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_BpfBase);

  /* "bpf4/core.pyx":2382
 *         BpfBase.__init__(self, xs, ys)
 * 
 *     def _get_points_for_rendering(self, int n= -1):             # <<<<<<<<<<<<<<
 *         return self.xs, self.ys
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_6Linear_3_get_points_for_rendering, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Linear__get_points_for_rendering, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Linear->tp_dict, __pyx_n_s_get_points_for_rendering, __pyx_t_1) < 0) __PYX_ERR(0, 2382, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Linear);

  /* "bpf4/core.pyx":2385
 *         return self.xs, self.ys
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         Integrate this bpf between the given x coords
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_6Linear_5integrate_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Linear_integrate_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Linear->tp_dict, __pyx_n_s_integrate_between, __pyx_t_1) < 0) __PYX_ERR(0, 2385, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Linear);

  /* "bpf4/core.pyx":2418
 *         return pre + mid + post
 * 
 *     cpdef Linear sliced(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         """
 *         Cut this bpf at the given points
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_6Linear_7sliced, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Linear_sliced, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Linear->tp_dict, __pyx_n_s_sliced, __pyx_t_1) < 0) __PYX_ERR(0, 2418, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Linear);

  /* "bpf4/core.pyx":2438
 *         return Linear(X, Y)
 * 
 *     def inverted(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a new Linear bpf where x and y coordinates are inverted.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_6Linear_9inverted, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Linear_inverted, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Linear->tp_dict, __pyx_n_s_inverted, __pyx_t_1) < 0) __PYX_ERR(0, 2438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Linear);

  /* "bpf4/core.pyx":2455
 *         return Linear(self.ys, self.xs)
 * 
 *     def flatpairs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a flat 1D array with x and y values interlaced
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_6Linear_11flatpairs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Linear_flatpairs, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Linear->tp_dict, __pyx_n_s_flatpairs, __pyx_t_1) < 0) __PYX_ERR(0, 2455, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Linear);

  /* "bpf4/core.pyx":2565
 *         super().__init__(xs, ys)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.xs, self.ys, self.interpol_func.exp, self.interpol_func.numiter
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Halfcos_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Halfcos___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__217)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Halfcos->tp_dict, __pyx_n_s_getstate, __pyx_t_1) < 0) __PYX_ERR(0, 2565, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Halfcos);

  /* "bpf4/core.pyx":2573
 * 
 * 
 * HalfcosExp = Halfcos             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HalfcosExp, ((PyObject *)__pyx_ptype_4bpf4_4core_Halfcos)) < 0) __PYX_ERR(0, 2573, __pyx_L1_error)

  /* "bpf4/core.pyx":2635
 *         self.interpol_func.numiter = numiter
 * 
 *     def __getstate__(self): return self.xs, self.ys, self.interpol_func.exp             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_5Expon_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Expon___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Expon->tp_dict, __pyx_n_s_getstate, __pyx_t_1) < 0) __PYX_ERR(0, 2635, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Expon);

  /* "bpf4/core.pyx":2637
 *     def __getstate__(self): return self.xs, self.ys, self.interpol_func.exp
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.xs, self.ys, exp = state
 *         self.interpol_func.exp = exp
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_5Expon_5__setstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Expon___setstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Expon->tp_dict, __pyx_n_s_setstate, __pyx_t_1) < 0) __PYX_ERR(0, 2637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Expon);

  /* "bpf4/core.pyx":2734
 *         self.interpol_func = InterpolFunc_nearest
 * 
 *     def __getstate__(self): return self.xs, self.ys             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Nearest_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Nearest___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Nearest->tp_dict, __pyx_n_s_getstate, __pyx_t_1) < 0) __PYX_ERR(0, 2734, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Nearest);

  /* "bpf4/core.pyx":2907
 *         return self._cached_xs
 * 
 *     def points(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple with the points defining this bpf
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Sampled_3points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sampled_points, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_points, __pyx_t_1) < 0) __PYX_ERR(0, 2907, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":2946
 *         return self.grid_dx
 * 
 *     cpdef Sampled set_interpolation(self, str interpolation):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the interpolation of this Sampled bpf, inplace
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Sampled_5set_interpolation, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sampled_set_interpolation, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_set_interpolation, __pyx_t_1) < 0) __PYX_ERR(0, 2946, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":2976
 *         InterpolFunc_free(self.interpolfunc)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.ys, self.grid_dx, self.grid_x0, self.interpolation)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Sampled_9__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sampled___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__229)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_getstate, __pyx_t_1) < 0) __PYX_ERR(0, 2976, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":3000
 * 
 *     @cython.cdivision(True)
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Sampled_11mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sampled_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__231)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_mapn_between, __pyx_t_1) < 0) __PYX_ERR(0, 3000, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":3069
 * 
 *     @classmethod
 *     def fromseq(cls, *args, **kws): raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def _get_points_for_rendering(self, int n= -1):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Sampled_13fromseq, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sampled_fromseq, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__233)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_fromseq, __pyx_t_1) < 0) __PYX_ERR(0, 3069, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":3068
 *         return out
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromseq(cls, *args, **kws): raise NotImplementedError
 * 
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_4bpf4_4core_Sampled, __pyx_n_s_fromseq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_fromseq, __pyx_t_2) < 0) __PYX_ERR(0, 3069, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":3071
 *     def fromseq(cls, *args, **kws): raise NotImplementedError
 * 
 *     def _get_points_for_rendering(self, int n= -1):             # <<<<<<<<<<<<<<
 *         return self.xs, self.ys
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Sampled_15_get_points_for_rendering, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sampled__get_points_for_renderin, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__235)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_get_points_for_rendering, __pyx_t_2) < 0) __PYX_ERR(0, 3071, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":3074
 *         return self.xs, self.ys
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Sampled_17segments, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sampled_segments, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_segments, __pyx_t_2) < 0) __PYX_ERR(0, 3074, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":3095
 *             yield (x0 + i*dx, self.data[i], descr, exp)
 * 
 *     cpdef double integrate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the result of the integration of this bpf.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Sampled_20integrate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sampled_integrate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_integrate, __pyx_t_2) < 0) __PYX_ERR(0, 3095, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":3113
 *         return _integr_trapz(self.data, self.samples_size, self.grid_dx)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         """
 *         The same as integrate() but between the (included) bounds x0-x1
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Sampled_22integrate_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sampled_integrate_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_integrate_between, __pyx_t_2) < 0) __PYX_ERR(0, 3113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":3124
 *         return _integr_trapz_between_exact(self.data, self.samples_size, dx, self.grid_x0, x0, x1)
 * 
 *     cpdef BpfInterface derivative(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a curve which represents the derivative of this curve
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Sampled_24derivative, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sampled_derivative, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__242)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_derivative, __pyx_t_2) < 0) __PYX_ERR(0, 3124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":3151
 *         return _BpfDeriv(self, self.grid_dx*0.99)
 * 
 *     def inverted(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return a view on this bpf with the coords inverted
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Sampled_26inverted, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sampled_inverted, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__244)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_inverted, __pyx_t_2) < 0) __PYX_ERR(0, 3151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":3175
 *         return Linear(self.xs, self.ys).inverted()
 * 
 *     def flatpairs(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a flat 1D array with x and y values interlaced
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7Sampled_28flatpairs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sampled_flatpairs, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__246)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Sampled->tp_dict, __pyx_n_s_flatpairs, __pyx_t_2) < 0) __PYX_ERR(0, 3175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Sampled);

  /* "bpf4/core.pyx":3245
 *         return (xs, ys)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self._points()
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_6Spline_5__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Spline___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Spline->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 3245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Spline);

  /* "bpf4/core.pyx":3248
 *         return self._points()
 * 
 *     def points(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a tuple with the points defining this bpf
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_6Spline_7points, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Spline_points, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Spline->tp_dict, __pyx_n_s_points, __pyx_t_2) < 0) __PYX_ERR(0, 3248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Spline);

  /* "bpf4/core.pyx":3269
 *         return self._points()
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_6Spline_9segments, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Spline_segments, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Spline->tp_dict, __pyx_n_s_segments, __pyx_t_2) < 0) __PYX_ERR(0, 3269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Spline);

  /* "bpf4/core.pyx":3339
 *             return self.spline__call__(x)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if out is not None:
 *             out[...] = self.spline__call__(xs)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7USpline_5map, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_USpline_map, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_USpline->tp_dict, __pyx_n_s_map, __pyx_t_2) < 0) __PYX_ERR(0, 3339, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_USpline);

  /* "bpf4/core.pyx":3346
 *             return self.spline__call__(xs)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7USpline_7mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_USpline_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__255)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_USpline->tp_dict, __pyx_n_s_mapn_between, __pyx_t_2) < 0) __PYX_ERR(0, 3346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_USpline);

  /* "bpf4/core.pyx":3370
 *             return self.spline
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7USpline_9segments, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_USpline_segments, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_USpline->tp_dict, __pyx_n_s_segments, __pyx_t_2) < 0) __PYX_ERR(0, 3370, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_USpline);

  /* "bpf4/core.pyx":3398
 *         return self.b.__ccall__(x)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b, self.splitpoint
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_11_BpfConcat2_1__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfConcat2___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__258)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfConcat2->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 3398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfConcat2);

  /* "bpf4/core.pyx":3401
 *         return self.a, self.b, self.splitpoint
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.a, self.b, self.splitpoint = state
 *         cdef double x0 = self.a._x0 if self.a._x0 < self.b._x0 else self.b._x0
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_11_BpfConcat2_3__setstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfConcat2___setstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__260)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfConcat2->tp_dict, __pyx_n_s_setstate, __pyx_t_2) < 0) __PYX_ERR(0, 3401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfConcat2);

  /* "bpf4/core.pyx":3446
 *         return self.offset + x*self.slope
 * 
 *     cpdef Slope _slice(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         return Slope(self.slope, self.offset, bounds=(x0, x1))
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_5Slope_3_slice, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Slope__slice, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__262)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Slope->tp_dict, __pyx_n_s_slice, __pyx_t_2) < 0) __PYX_ERR(0, 3446, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Slope);

  /* "bpf4/core.pyx":3466
 *             return _create_rlambda(a, b, _BpfLambdaSub, _BpfLambdaSubConst, _BpfLambdaRSub, _BpfLambdaRSubConst)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_5Slope_9mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Slope_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__264)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Slope->tp_dict, __pyx_n_s_mapn_between, __pyx_t_2) < 0) __PYX_ERR(0, 3466, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Slope);

  /* "bpf4/core.pyx":3508
 *         return BpfInterface.__mul__(a, b)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.slope, self.offset, self.bounds()
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_5Slope_13__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Slope___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__266)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Slope->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 3508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Slope);

  /* "bpf4/core.pyx":3523
 *         return self.b.__ccall__(x)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_11_BpfCompose_1__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfCompose___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__268)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfCompose->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 3523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfCompose);

  /* "bpf4/core.pyx":3526
 *         return self.a, self.b
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.a, self.b = state
 *         self._set_bounds(self.a._x0, self.a._x1)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_11_BpfCompose_3__setstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfCompose___setstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__270)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfCompose->tp_dict, __pyx_n_s_setstate, __pyx_t_2) < 0) __PYX_ERR(0, 3526, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfCompose);

  /* "bpf4/core.pyx":3530
 *         self._set_bounds(self.a._x0, self.a._x1)
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an array of `n` elements resulting of evaluating this bpf regularly
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_11_BpfCompose_5mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfCompose_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__272)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfCompose->tp_dict, __pyx_n_s_mapn_between, __pyx_t_2) < 0) __PYX_ERR(0, 3530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfCompose);

  /* "bpf4/core.pyx":3637
 *             return self.last_bpf.__ccall__(x)
 * 
 *     cpdef BpfInterface concat(self, BpfInterface other, double fadetime=0, fadeshape='expon(3)'):             # <<<<<<<<<<<<<<
 *         cdef BpfInterface other2 = other.fit_between(self._x1, self._x1 + (other._x1 - other._x0))
 *         cdef int i
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_10_BpfConcat_7concat, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfConcat_concat, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__274)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfConcat->tp_dict, __pyx_n_s_concat, __pyx_t_2) < 0) __PYX_ERR(0, 3637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfConcat);

  /* "bpf4/core.pyx":3649
 *         raise NotImplementedError("fade is not implemented")
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         cdef list xs
 *         cdef int i
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_10_BpfConcat_9__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfConcat___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__276)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfConcat->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 3649, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfConcat);

  /* "bpf4/core.pyx":3682
 *         return ya + yb
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b, self.which
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_9_BpfBlend_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBlend___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__278)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfBlend->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 3682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfBlend);

  /* "bpf4/core.pyx":3707
 *         return self.a.__ccall__(x) * (1 - self.which) + self.b.__ccall__(x) * self.which
 * 
 *     def __getstate__(self): return self.a, self.b, self.which             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_14_BpfBlendConst_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBlendConst___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__280)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfBlendConst->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfBlendConst);

  /* "bpf4/core.pyx":3770
 *         free(self.interpolations)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         xs = [self.xs[i] for i in range(self.size)]
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_5Multi_7__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Multi___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__282)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Multi->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 3770, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Multi);

  /* "bpf4/core.pyx":3800
 *         return res
 * 
 *     def segments(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns an iterator over the segments of this bpf
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_5Multi_9segments, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Multi_segments, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Multi->tp_dict, __pyx_n_s_segments, __pyx_t_2) < 0) __PYX_ERR(0, 3800, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Multi);

  /* "bpf4/core.pyx":3820
 * 
 * 
 * def _FunctionWrap(f, bounds=(INFNEG, INF)):             # <<<<<<<<<<<<<<
 *     return _FunctionWrap_Object(f, bounds)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_7_FunctionWrap, 0, __pyx_n_s_FunctionWrap, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__285)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__286);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionWrap, __pyx_t_2) < 0) __PYX_ERR(0, 3820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bpf4/core.pyx":3840
 *             return self.f(x)
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.f, (self._x0, self._x1))
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_20_FunctionWrap_Object_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FunctionWrap_Object___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__288)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__FunctionWrap_Object->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 3840, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__FunctionWrap_Object);

  /* "bpf4/core.pyx":3843
 *         return (self.f, (self._x0, self._x1))
 * 
 *     cpdef BpfInterface _slice(self, double x0, double x1):             # <<<<<<<<<<<<<<
 *         return _FunctionWrap_Object_OutboundConst_new(self, x0, x1)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_20_FunctionWrap_Object_5_slice, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FunctionWrap_Object__slice, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__290)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__FunctionWrap_Object->tp_dict, __pyx_n_s_slice, __pyx_t_2) < 0) __PYX_ERR(0, 3843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__FunctionWrap_Object);

  /* "bpf4/core.pyx":3846
 *         return _FunctionWrap_Object_OutboundConst_new(self, x0, x1)
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_20_FunctionWrap_Object_7map, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FunctionWrap_Object_map, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__292)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__FunctionWrap_Object->tp_dict, __pyx_n_s_map, __pyx_t_2) < 0) __PYX_ERR(0, 3846, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__FunctionWrap_Object);

  /* "bpf4/core.pyx":3904
 *         return result
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         xs = numpy.linspace(x0, x1, n)
 *         return self.map(xs, out=out)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_20_FunctionWrap_Object_9mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FunctionWrap_Object_mapn_betwee, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__294)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__FunctionWrap_Object->tp_dict, __pyx_n_s_mapn_between, __pyx_t_2) < 0) __PYX_ERR(0, 3904, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__FunctionWrap_Object);

  /* "bpf4/core.pyx":3951
 *         return self.value
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.value,)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_5Const_5__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Const___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__296)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Const->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 3951, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Const);

  /* "bpf4/core.pyx":3954
 *         return (self.value,)
 * 
 *     def _get_points_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         x0 = self._x0 if self._x0 > INFNEG else 0.
 *         x1 = self._x1 if self._x1 < INF else 1.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_5Const_7_get_points_for_rendering, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Const__get_points_for_rendering, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__298)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Const->tp_dict, __pyx_n_s_get_points_for_rendering, __pyx_t_2) < 0) __PYX_ERR(0, 3954, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Const);

  /* "bpf4/core.pyx":3968
 *         return out
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if out is not None:
 *             out[...] = self.value
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_5Const_11mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Const_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__300)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core_Const->tp_dict, __pyx_n_s_mapn_between, __pyx_t_2) < 0) __PYX_ERR(0, 3968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core_Const);

  /* "bpf4/core.pyx":4030
 *         self._x0, self._x1 = bounds
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b, (self._x0, self._x1)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_9_BpfBinOp_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBinOp___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__302)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfBinOp->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 4030, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfBinOp);

  /* "bpf4/core.pyx":4033
 *         return self.a, self.b, (self._x0, self._x1)
 * 
 *     def _get_xs_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         return numpy.unique(numpy.append(self.a._get_xs_for_rendering(n), self.b._get_xs_for_rendering(n)))
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_9_BpfBinOp_5_get_xs_for_rendering, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBinOp__get_xs_for_rendering, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__304)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfBinOp->tp_dict, __pyx_n_s_get_xs_for_rendering, __pyx_t_2) < 0) __PYX_ERR(0, 4033, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfBinOp);

  /* "bpf4/core.pyx":4046
 *         pass
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = <ndarray>out if out is not None else EMPTY1D(n)
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] B = EMPTY1D(n)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_9_BpfBinOp_7mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBinOp_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__306)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfBinOp->tp_dict, __pyx_n_s_mapn_between, __pyx_t_2) < 0) __PYX_ERR(0, 4046, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfBinOp);

  /* "bpf4/core.pyx":4058
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_9_BpfBinOp_9map, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBinOp_map, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__308)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfBinOp->tp_dict, __pyx_n_s_map, __pyx_t_2) < 0) __PYX_ERR(0, 4058, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfBinOp);

  /* "bpf4/core.pyx":4086
 *     cdef int funcindex
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), (), self.a, self.funcindex
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13_BpfUnaryFunc_1__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfUnaryFunc___reduce, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__310)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfUnaryFunc->tp_dict, __pyx_n_s_reduce, __pyx_t_2) < 0) __PYX_ERR(0, 4086, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfUnaryFunc);

  /* "bpf4/core.pyx":4089
 *         return type(self), (), self.a, self.funcindex
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         bpf, funcindex = state
 *         return _BpfUnaryFunc_new_from_index(bpf, funcindex)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13_BpfUnaryFunc_3__setstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfUnaryFunc___setstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__312)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfUnaryFunc->tp_dict, __pyx_n_s_setstate, __pyx_t_2) < 0) __PYX_ERR(0, 4089, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfUnaryFunc);

  /* "bpf4/core.pyx":4101
 *         return self.func(self.a.__ccall__(x))
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         cdef t_unfunc func = self.func
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13_BpfUnaryFunc_5mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfUnaryFunc_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__314)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfUnaryFunc->tp_dict, __pyx_n_s_mapn_between, __pyx_t_2) < 0) __PYX_ERR(0, 4101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfUnaryFunc);

  /* "bpf4/core.pyx":4108
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13_BpfUnaryFunc_7map, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfUnaryFunc_map, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__316)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfUnaryFunc->tp_dict, __pyx_n_s_map, __pyx_t_2) < 0) __PYX_ERR(0, 4108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfUnaryFunc);

  /* "bpf4/core.pyx":4163
 *         return X
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.a,)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_11_BpfUnaryOp_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfUnaryOp___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__318)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfUnaryOp->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 4163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfUnaryOp);

  /* "bpf4/core.pyx":4166
 *         return (self.a,)
 * 
 *     def _get_xs_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         return self.a._get_xs_for_rendering(n)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_11_BpfUnaryOp_5_get_xs_for_rendering, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfUnaryOp__get_xs_for_renderin, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__320)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfUnaryOp->tp_dict, __pyx_n_s_get_xs_for_rendering, __pyx_t_2) < 0) __PYX_ERR(0, 4166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfUnaryOp);

  /* "bpf4/core.pyx":4172
 *         pass
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef c_numpy.ndarray[DTYPE_t, ndim=1] A = self.a.mapn_between(n, x0, x1, out)
 *         with nogil:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_11_BpfUnaryOp_7mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfUnaryOp_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__322)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfUnaryOp->tp_dict, __pyx_n_s_mapn_between, __pyx_t_2) < 0) __PYX_ERR(0, 4172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfUnaryOp);

  /* "bpf4/core.pyx":4178
 *         return A
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_11_BpfUnaryOp_9map, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfUnaryOp_map, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__324)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfUnaryOp->tp_dict, __pyx_n_s_map, __pyx_t_2) < 0) __PYX_ERR(0, 4178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfUnaryOp);

  /* "bpf4/core.pyx":4208
 *         self._x0, self._x1 = bounds
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return self.a, self.b_const, (self._x0, self._x1)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_14_BpfBinOpConst_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBinOpConst___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfBinOpConst->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 4208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfBinOpConst);

  /* "bpf4/core.pyx":4211
 *         return self.a, self.b_const, (self._x0, self._x1)
 * 
 *     def _get_xs_for_rendering(self, int n):             # <<<<<<<<<<<<<<
 *         return self.a._get_xs_for_rendering(n)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_14_BpfBinOpConst_5_get_xs_for_rendering, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBinOpConst__get_xs_for_rende, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfBinOpConst->tp_dict, __pyx_n_s_get_xs_for_rendering, __pyx_t_2) < 0) __PYX_ERR(0, 4211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfBinOpConst);

  /* "bpf4/core.pyx":4217
 *         pass
 * 
 *     cpdef ndarray map(self, xs, ndarray out=None):             # <<<<<<<<<<<<<<
 *         """
 *         the same as map(self, xs) but somewhat faster
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_14_BpfBinOpConst_7map, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfBinOpConst_map, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__330)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfBinOpConst->tp_dict, __pyx_n_s_map, __pyx_t_2) < 0) __PYX_ERR(0, 4217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfBinOpConst);

  /* "bpf4/core.pyx":4260
 *             A[i] += B[i]
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) + self.b.integrate_between(x0, x1, N)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13_BpfLambdaAdd_1integrate_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfLambdaAdd_integrate_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__332)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaAdd->tp_dict, __pyx_n_s_integrate_between, __pyx_t_2) < 0) __PYX_ERR(0, 4260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfLambdaAdd);

  /* "bpf4/core.pyx":4284
 *                 return _BpfBinOpConst.__add__(b, a)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) + (x1 - x0) * self.b_const
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_18_BpfLambdaAddConst_3integrate_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfLambdaAddConst_integrate_bet, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__334)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaAddConst->tp_dict, __pyx_n_s_integrate_between, __pyx_t_2) < 0) __PYX_ERR(0, 4284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfLambdaAddConst);

  /* "bpf4/core.pyx":4292
 *         for i in range(n):
 *             A[i] -= B[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) - self.b.integrate_between(x0, x1, N)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13_BpfLambdaSub_1integrate_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfLambdaSub_integrate_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__336)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaSub->tp_dict, __pyx_n_s_integrate_between, __pyx_t_2) < 0) __PYX_ERR(0, 4292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfLambdaSub);

  /* "bpf4/core.pyx":4300
 *         for i in range(n):
 *             B[i] -= A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.b.integrate_between(x0, x1, N) - self.a.integrate_between(x0, x1, N)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_14_BpfLambdaRSub_1integrate_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfLambdaRSub_integrate_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__338)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRSub->tp_dict, __pyx_n_s_integrate_between, __pyx_t_2) < 0) __PYX_ERR(0, 4300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfLambdaRSub);

  /* "bpf4/core.pyx":4308
 *         for i in range(n):
 *             A[i] -= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) - (x1-x0)*self.b_const
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_18_BpfLambdaSubConst_1integrate_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfLambdaSubConst_integrate_bet, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__340)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaSubConst->tp_dict, __pyx_n_s_integrate_between, __pyx_t_2) < 0) __PYX_ERR(0, 4308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfLambdaSubConst);

  /* "bpf4/core.pyx":4316
 *         for i in range(n):
 *             A[i] = b - A[i]
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.b_const*(x1-x0) - self.a.integrate_between(x0, x1, N)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_19_BpfLambdaRSubConst_1integrate_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfLambdaRSubConst_integrate_be, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__342)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaRSubConst->tp_dict, __pyx_n_s_integrate_between, __pyx_t_2) < 0) __PYX_ERR(0, 4316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfLambdaRSubConst);

  /* "bpf4/core.pyx":4330
 *         for i in range(n):
 *             A[i] *= b
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         return self.a.integrate_between(x0, x1, N) * self.b_const
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_18_BpfLambdaMulConst_1integrate_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfLambdaMulConst_integrate_bet, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__344)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaMulConst->tp_dict, __pyx_n_s_integrate_between, __pyx_t_2) < 0) __PYX_ERR(0, 4330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfLambdaMulConst);

  /* "bpf4/core.pyx":4542
 *             return self.y0
 *         return y
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ndarray [DTYPE_t, ndim=1] result
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_14_BpfLambdaClip_1mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfLambdaClip_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__346)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaClip->tp_dict, __pyx_n_s_mapn_between, __pyx_t_2) < 0) __PYX_ERR(0, 4542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfLambdaClip);

  /* "bpf4/core.pyx":4578
 *             return out
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), (), (self.bpf, self.y0, self.y1)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_14_BpfLambdaClip_3__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfLambdaClip___reduce, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__348)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaClip->tp_dict, __pyx_n_s_reduce, __pyx_t_2) < 0) __PYX_ERR(0, 4578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfLambdaClip);

  /* "bpf4/core.pyx":4581
 *         return type(self), (), (self.bpf, self.y0, self.y1)
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.bpf, self.y0, self.y1 = state
 *         self._set_bounds_like(self.bpf)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_14_BpfLambdaClip_5__setstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfLambdaClip___setstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__350)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfLambdaClip->tp_dict, __pyx_n_s_setstate, __pyx_t_2) < 0) __PYX_ERR(0, 4581, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfLambdaClip);

  /* "bpf4/core.pyx":4630
 *         return (f1 - f0) / h
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.bpf,)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_9_BpfDeriv_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfDeriv___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__352)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfDeriv->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 4630, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfDeriv);

  /* "bpf4/core.pyx":4660
 *         return out
 * 
 *     def __getstate__(self): return (self.bpf,)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12_BpfInverted_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfInverted___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__354)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfInverted->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 4660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfInverted);

  /* "bpf4/core.pyx":4716
 * 
 *     @cython.cdivision(True)
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         cdef double [::1] accums
 *         cdef double dx0, dx1, dy
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13_BpfIntegrate_3mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfIntegrate_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__356)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfIntegrate->tp_dict, __pyx_n_s_mapn_between, __pyx_t_2) < 0) __PYX_ERR(0, 4716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfIntegrate);

  /* "bpf4/core.pyx":4741
 *             return numpy.asarray(accums)
 * 
 *     cpdef BpfInterface derivative(self):             # <<<<<<<<<<<<<<
 *         return self.bpf
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13_BpfIntegrate_5derivative, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfIntegrate_derivative, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__358)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfIntegrate->tp_dict, __pyx_n_s_derivative, __pyx_t_2) < 0) __PYX_ERR(0, 4741, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfIntegrate);

  /* "bpf4/core.pyx":4744
 *         return self.bpf
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         return (self.bpf, self.N, self.bounds(), self.min_N_ratio, self.Nexp)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13_BpfIntegrate_7__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfIntegrate___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__360)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfIntegrate->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 4744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfIntegrate);

  /* "bpf4/core.pyx":4769
 *         return self.bpf.__ccall__( p )
 * 
 *     def __getstate__(self): return (self.bpf,)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_12_BpfPeriodic_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfPeriodic___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__362)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfPeriodic->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 4769, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfPeriodic);

  /* "bpf4/core.pyx":4807
 *         return self.bpf.__ccall__(x)
 * 
 *     def fixpoint(self):             # <<<<<<<<<<<<<<
 *         return 1 - (self.fx - self.offset*self.rx)/self.rx
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_14_BpfProjection_3fixpoint, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfProjection_fixpoint, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__364)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfProjection->tp_dict, __pyx_n_s_fixpoint, __pyx_t_2) < 0) __PYX_ERR(0, 4807, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfProjection);

  /* "bpf4/core.pyx":4810
 *         return 1 - (self.fx - self.offset*self.rx)/self.rx
 * 
 *     def __getstate__(self): return (self.bpf, self.rx, self.dx, self.bounds())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_14_BpfProjection_5__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfProjection___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__366)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfProjection->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 4810, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfProjection);

  /* "bpf4/core.pyx":4854
 *             return self.bpf.__ccall__(x0) + slope * (x - x0)
 * 
 *     def __getstate__(self): return self.bpf, self.EPSILON             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13_BpfKeepSlope_3__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfKeepSlope___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__368)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfKeepSlope->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 4854, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfKeepSlope);

  /* "bpf4/core.pyx":4872
 *             return self.bpf.__ccall__(x)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return type(self), (), (self.bpf, self._x0, self._x1, self.outbound_mode, self._y0, self._y1)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_8_BpfCrop_1__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfCrop___reduce, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__370)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfCrop->tp_dict, __pyx_n_s_reduce, __pyx_t_2) < 0) __PYX_ERR(0, 4872, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfCrop);

  /* "bpf4/core.pyx":4875
 *         return type(self), (), (self.bpf, self._x0, self._x1, self.outbound_mode, self._y0, self._y1)
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.bpf, x0, x1, self.outbound_mode, self._y0, self._y1 = state
 *         self._set_bounds(x0, x1)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_8_BpfCrop_3__setstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfCrop___setstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__372)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfCrop->tp_dict, __pyx_n_s_setstate, __pyx_t_2) < 0) __PYX_ERR(0, 4875, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfCrop);

  /* "bpf4/core.pyx":4879
 *         self._set_bounds(x0, x1)
 * 
 *     cpdef _BpfCrop outbound_set(self, double y0, double y1):             # <<<<<<<<<<<<<<
 *         """
 *         set the value returned by this BPF outside its defined bounds (inplace)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_8_BpfCrop_5outbound_set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfCrop_outbound_set, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__374)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfCrop->tp_dict, __pyx_n_s_outbound_set, __pyx_t_2) < 0) __PYX_ERR(0, 4879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfCrop);

  /* "bpf4/core.pyx":4888
 *         return self
 * 
 *     def outbound(self, double y0, y1=None):             # <<<<<<<<<<<<<<
 *         """
 *         return a new Bpf with the given values outside the bounds
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_8_BpfCrop_7outbound, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfCrop_outbound, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__376)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfCrop->tp_dict, __pyx_n_s_outbound, __pyx_t_2) < 0) __PYX_ERR(0, 4888, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfCrop);

  /* "bpf4/core.pyx":4901
 *         return _BpfCrop_new(self.bpf, self._x0, self._x1, OUTBOUND_SET, y0, y1)
 * 
 *     cpdef double integrate_between(self, double x0, double x1, size_t N=0):             # <<<<<<<<<<<<<<
 *         if x0 >= self.bpf._x0 and x1 <= self.bpf._x1:
 *             return self.bpf.integrate_between(x0, x1)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_8_BpfCrop_9integrate_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfCrop_integrate_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__378)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfCrop->tp_dict, __pyx_n_s_integrate_between, __pyx_t_2) < 0) __PYX_ERR(0, 4901, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfCrop);

  /* "bpf4/core.pyx":4918
 *         return integr0 + integr1 + integr2
 * 
 *     cpdef ndarray mapn_between(self, int n, double x0, double x1, ndarray out=None):             # <<<<<<<<<<<<<<
 *         if self.outbound_mode == OUTBOUND_DONOTHING:
 *             return self.bpf.mapn_between(n, x0, x1, out)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_8_BpfCrop_11mapn_between, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BpfCrop_mapn_between, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__380)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__BpfCrop->tp_dict, __pyx_n_s_mapn_between, __pyx_t_2) < 0) __PYX_ERR(0, 4918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__BpfCrop);

  /* "bpf4/core.pyx":4965
 * 
 * 
 * cpdef _BpfCrop _BpfCrop_new(BpfInterface bpf, double x0, double x1, int outbound_mode,             # <<<<<<<<<<<<<<
 *                             double outbound0=0, double outbound1=0):
 *     """
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_9_BpfCrop_new, 0, __pyx_n_s_BpfCrop_new, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__382)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BpfCrop_new, __pyx_t_2) < 0) __PYX_ERR(0, 4965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bpf4/core.pyx":5012
 *         free(self.bpfpointers)
 * 
 *     def _calculate_bounds(self):             # <<<<<<<<<<<<<<
 *         cdef double bounds0, bounds1
 *         cdef double x0=INF, x1=INFNEG
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13_MultipleBpfs_5_calculate_bounds, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultipleBpfs__calculate_bounds, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__384)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__MultipleBpfs->tp_dict, __pyx_n_s_calculate_bounds, __pyx_t_2) < 0) __PYX_ERR(0, 5012, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__MultipleBpfs);

  /* "bpf4/core.pyx":5023
 *         self._set_bounds(x0, x1)
 * 
 *     def __getstate__(self): return (self._bpfs,)             # <<<<<<<<<<<<<<
 * 
 *     cdef double __ccall__(self, double x) nogil:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13_MultipleBpfs_7__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultipleBpfs___getstate, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__386)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_4bpf4_4core__MultipleBpfs->tp_dict, __pyx_n_s_getstate, __pyx_t_2) < 0) __PYX_ERR(0, 5023, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_4bpf4_4core__MultipleBpfs);

  /* "bpf4/core.pyx":5140
 *             return InterpolFunc_call(self.func, index, x0, y0, x0+1, y1)
 * 
 * def brentq(bpf, double x0, double xa, double xb, double xtol=9.9999999999999998e-13,             # <<<<<<<<<<<<<<
 *            double rtol=4.4408920985006262e-16, max_iter=100):
 *     """
 */
  __pyx_t_2 = PyFloat_FromDouble(((double)9.9999999999999998e-13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "bpf4/core.pyx":5141
 * 
 * def brentq(bpf, double x0, double xa, double xb, double xtol=9.9999999999999998e-13,
 *            double rtol=4.4408920985006262e-16, max_iter=100):             # <<<<<<<<<<<<<<
 *     """
 *     calculate the zero of (bpf + x0) in the interval (xa, xb) using brentq algorithm
 */
  __pyx_t_1 = PyFloat_FromDouble(((double)4.4408920985006262e-16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "bpf4/core.pyx":5140
 *             return InterpolFunc_call(self.func, index, x0, y0, x0+1, y1)
 * 
 * def brentq(bpf, double x0, double xa, double xb, double xtol=9.9999999999999998e-13,             # <<<<<<<<<<<<<<
 *            double rtol=4.4408920985006262e-16, max_iter=100):
 *     """
 */
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_int_100));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_100));
  PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_int_100));
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_11brentq, 0, __pyx_n_s_brentq, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__388)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_brentq, __pyx_t_1) < 0) __PYX_ERR(0, 5140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":5182
 * 
 * 
 * cpdef BpfInterface blend(a, b, mix=0.5):             # <<<<<<<<<<<<<<
 *     """
 *     Blend these BPFs
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_13blend, 0, __pyx_n_s_blend, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__390)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blend, __pyx_t_1) < 0) __PYX_ERR(0, 5182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":5317
 * @cython.cdivision(True)
 * cpdef list bpf_zero_crossings(BpfInterface b, double h=0.01, int N=0,
 *                               double x0=NAN, double x1=NAN, int maxzeros=0):             # <<<<<<<<<<<<<<
 *     """
 *     Return the zeros if b in the interval defined
 */
  __pyx_k__36 = NAN;
  __pyx_k__37 = NAN;

  /* "bpf4/core.pyx":5316
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cpdef list bpf_zero_crossings(BpfInterface b, double h=0.01, int N=0,             # <<<<<<<<<<<<<<
 *                               double x0=NAN, double x1=NAN, int maxzeros=0):
 *     """
 */
  __pyx_k__36 = NAN;

  /* "bpf4/core.pyx":5317
 * @cython.cdivision(True)
 * cpdef list bpf_zero_crossings(BpfInterface b, double h=0.01, int N=0,
 *                               double x0=NAN, double x1=NAN, int maxzeros=0):             # <<<<<<<<<<<<<<
 *     """
 *     Return the zeros if b in the interval defined
 */
  __pyx_k__37 = NAN;

  /* "bpf4/core.pyx":5316
 * @cython.boundscheck(False)
 * @cython.cdivision(True)
 * cpdef list bpf_zero_crossings(BpfInterface b, double h=0.01, int N=0,             # <<<<<<<<<<<<<<
 *                               double x0=NAN, double x1=NAN, int maxzeros=0):
 *     """
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4bpf4_4core_15bpf_zero_crossings, 0, __pyx_n_s_bpf_zero_crossings, NULL, __pyx_n_s_bpf4_core, __pyx_d, ((PyObject *)__pyx_codeobj__392)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bpf_zero_crossings, __pyx_t_1) < 0) __PYX_ERR(0, 5316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bpf4/core.pyx":1
 * # cython: binding=True             # <<<<<<<<<<<<<<
 * # cython: boundscheck=False
 * # cython: embedsignature=True
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(30); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_bounds_line_717, __pyx_kp_u_Returns_a_tuple_xstart_xend_rep) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_render_line_892, __pyx_kp_u_Create_a_new_bpf_representing_t) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_sample_between_line, __pyx_kp_u_Sample_this_bpf_at_an_interval) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_map_line_1106, __pyx_kp_u_The_same_as_map_self_xs_but_fas) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_concat_line_1147, __pyx_kp_u_Concatenate_this_bpf_to_other_o) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_expon_line_1202, __pyx_kp_u_Returns_a_bpf_representing_the_e) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_m2f_line_1269, __pyx_kp_u_Returns_a_bpf_converting_from_mi) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_f2m_line_1289, __pyx_kp_u_Returns_a_bpf_converting_frequen) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_db2amp_line_1307, __pyx_kp_u_Returns_a_bpf_converting_decibe) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_amp2db_line_1324, __pyx_kp_u_Returns_a_bpf_converting_linear) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_clip_line_1342, __pyx_kp_u_Return_a_bpf_clipping_the_resul) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_derivative_line_136, __pyx_kp_u_Create_a_curve_which_represents) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_integrate_line_1428, __pyx_kp_u_Return_the_result_of_the_integr) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_zeros_line_1529, __pyx_kp_u_Find_the_zeros_of_this_bpf_Args) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_max_line_1560, __pyx_kp_u_Returns_a_bpf_representing_max) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_min_line_1588, __pyx_kp_u_Returns_a_bpf_representing_min) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_outbound_line_1664, __pyx_kp_u_Return_a_new_Bpf_with_the_given) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_apply_line_1691, __pyx_kp_u_Create_a_bpf_where_func_is_appl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_preapply_line_1723, __pyx_kp_u_Create_a_bpf_where_func_is_appl_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_periodic_line_1753, __pyx_kp_u_Create_a_new_bpf_which_replicat) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_stretched_line_1777, __pyx_kp_u_Returns_a_view_of_this_bpf_stre) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_fit_between_line_18, __pyx_kp_u_Returns_a_view_of_this_bpf_fitt) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfInterface_shifted_line_1861, __pyx_kp_u_Returns_a_view_of_this_bpf_shif) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_BpfBase_points_line_2246, __pyx_kp_u_Returns_a_tuple_with_the_points) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_Linear_flatpairs_line_2455, __pyx_kp_u_Returns_a_flat_1D_array_with_x) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_Sampled_points_line_2907, __pyx_kp_u_Returns_a_tuple_with_the_points_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_Sampled_derivative_line_3124, __pyx_kp_u_Return_a_curve_which_represents) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_Sampled_flatpairs_line_3175, __pyx_kp_u_Returns_a_flat_1D_array_with_x_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_Spline_points_line_3248, __pyx_kp_u_Returns_a_tuple_with_the_points) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_brentq_line_5140, __pyx_kp_u_calculate_the_zero_of_bpf_x0_in) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":209
 *         info.obj = self
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(array self):
 */
  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_array_type);

  /* "View.MemoryView":286
 *         return self.name
 * 
 * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__393, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(generic);
  __Pyx_DECREF_SET(generic, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":287
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__394, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(strided);
  __Pyx_DECREF_SET(strided, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":288
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__395, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(indirect);
  __Pyx_DECREF_SET(indirect, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":291
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__396, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(contiguous);
  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":292
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__397, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(indirect_contiguous);
  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":316
 * 
 * DEF THREAD_LOCKS_PREALLOCATED = 8
 * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
 * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
 *     PyThread_allocate_lock(),
 */
  __pyx_memoryview_thread_locks_used = 0;

  /* "View.MemoryView":317
 * DEF THREAD_LOCKS_PREALLOCATED = 8
 * cdef int __pyx_memoryview_thread_locks_used = 0
 * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
 *     PyThread_allocate_lock(),
 *     PyThread_allocate_lock(),
 */
  __pyx_t_8[0] = PyThread_allocate_lock();
  __pyx_t_8[1] = PyThread_allocate_lock();
  __pyx_t_8[2] = PyThread_allocate_lock();
  __pyx_t_8[3] = PyThread_allocate_lock();
  __pyx_t_8[4] = PyThread_allocate_lock();
  __pyx_t_8[5] = PyThread_allocate_lock();
  __pyx_t_8[6] = PyThread_allocate_lock();
  __pyx_t_8[7] = PyThread_allocate_lock();
  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_8, sizeof(__pyx_memoryview_thread_locks[0]) * (8));

  /* "View.MemoryView":549
 *         info.obj = self
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_memoryview_type);

  /* "View.MemoryView":995
 *         return self.from_object
 * 
 *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 995, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_memoryviewslice_type);

  /* "(tree fragment)":1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init bpf4.core", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init bpf4.core");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (__Pyx_PyFastCFunction_Check(func)) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* pyobject_as_double */
static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if !CYTHON_USE_TYPE_SLOTS
    float_value = PyNumber_Float(obj);  if ((0)) goto bad;
#else
    PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
    if (likely(nb) && likely(nb->nb_float)) {
        float_value = nb->nb_float(obj);
        if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
            PyErr_Format(PyExc_TypeError,
                "__float__ returned non-float (type %.200s)",
                Py_TYPE(float_value)->tp_name);
            Py_DECREF(float_value);
            goto bad;
        }
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      CYTHON_UNUSED Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind;
    Py_ssize_t i, char_pos;
    void *result_udata;
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely(char_pos + ulength < 0))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    result_ulength++;
    value_count++;
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* MemviewSliceInit */
static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
                        int ndim,
                        __Pyx_memviewslice *memviewslice,
                        int memview_is_new_reference)
{
    __Pyx_RefNannyDeclarations
    int i, retval=-1;
    Py_buffer *buf = &memview->view;
    __Pyx_RefNannySetupContext("init_memviewslice", 0);
    if (unlikely(memviewslice->memview || memviewslice->data)) {
        PyErr_SetString(PyExc_ValueError,
            "memviewslice is already initialized!");
        goto fail;
    }
    if (buf->strides) {
        for (i = 0; i < ndim; i++) {
            memviewslice->strides[i] = buf->strides[i];
        }
    } else {
        Py_ssize_t stride = buf->itemsize;
        for (i = ndim - 1; i >= 0; i--) {
            memviewslice->strides[i] = stride;
            stride *= buf->shape[i];
        }
    }
    for (i = 0; i < ndim; i++) {
        memviewslice->shape[i]   = buf->shape[i];
        if (buf->suboffsets) {
            memviewslice->suboffsets[i] = buf->suboffsets[i];
        } else {
            memviewslice->suboffsets[i] = -1;
        }
    }
    memviewslice->memview = memview;
    memviewslice->data = (char *)buf->buf;
    if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
        Py_INCREF(memview);
    }
    retval = 0;
    goto no_fail;
fail:
    memviewslice->memview = 0;
    memviewslice->data = 0;
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}
#ifndef Py_NO_RETURN
#define Py_NO_RETURN
#endif
static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
    va_list vargs;
    char msg[200];
#ifdef HAVE_STDARG_PROTOTYPES
    va_start(vargs, fmt);
#else
    va_start(vargs);
#endif
    vsnprintf(msg, 200, fmt, vargs);
    va_end(vargs);
    Py_FatalError(msg);
}
static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
                                   PyThread_type_lock lock)
{
    int result;
    PyThread_acquire_lock(lock, 1);
    result = (*acquisition_count)++;
    PyThread_release_lock(lock);
    return result;
}
static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
                                   PyThread_type_lock lock)
{
    int result;
    PyThread_acquire_lock(lock, 1);
    result = (*acquisition_count)--;
    PyThread_release_lock(lock);
    return result;
}
static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
{
    int first_time;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (unlikely(!memview || (PyObject *) memview == Py_None))
        return;
    if (unlikely(__pyx_get_slice_count(memview) < 0))
        __pyx_fatalerror("Acquisition count is %d (line %d)",
                         __pyx_get_slice_count(memview), lineno);
    first_time = __pyx_add_acquisition_count(memview) == 0;
    if (unlikely(first_time)) {
        if (have_gil) {
            Py_INCREF((PyObject *) memview);
        } else {
            PyGILState_STATE _gilstate = PyGILState_Ensure();
            Py_INCREF((PyObject *) memview);
            PyGILState_Release(_gilstate);
        }
    }
}
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
                                             int have_gil, int lineno) {
    int last_time;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (unlikely(!memview || (PyObject *) memview == Py_None)) {
        memslice->memview = NULL;
        return;
    }
    if (unlikely(__pyx_get_slice_count(memview) <= 0))
        __pyx_fatalerror("Acquisition count is %d (line %d)",
                         __pyx_get_slice_count(memview), lineno);
    last_time = __pyx_sub_acquisition_count(memview) == 1;
    memslice->data = NULL;
    if (unlikely(last_time)) {
        if (have_gil) {
            Py_CLEAR(memslice->memview);
        } else {
            PyGILState_STATE _gilstate = PyGILState_Ensure();
            Py_CLEAR(memslice->memview);
            PyGILState_Release(_gilstate);
        }
    } else {
        memslice->memview = NULL;
    }
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = Py_TYPE(iter)->tp_iternext;
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* MergeKeywords */
static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
    PyObject *iter, *key = NULL, *value = NULL;
    int source_is_dict, result;
    Py_ssize_t orig_length, ppos = 0;
    iter = __Pyx_dict_iterator(source_mapping, 0, __pyx_n_s_items, &orig_length, &source_is_dict);
    if (unlikely(!iter)) {
        PyObject *args;
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        args = PyTuple_Pack(1, source_mapping);
        if (likely(args)) {
            PyObject *fallback = PyObject_Call((PyObject*)&PyDict_Type, args, NULL);
            Py_DECREF(args);
            if (likely(fallback)) {
                iter = __Pyx_dict_iterator(fallback, 1, __pyx_n_s_items, &orig_length, &source_is_dict);
                Py_DECREF(fallback);
            }
        }
        if (unlikely(!iter)) goto bad;
    }
    while (1) {
        result = __Pyx_dict_iter_next(iter, orig_length, &ppos, &key, &value, NULL, source_is_dict);
        if (unlikely(result < 0)) goto bad;
        if (!result) break;
        if (unlikely(PyDict_Contains(kwdict, key))) {
            __Pyx_RaiseDoubleKeywordsError("function", key);
            result = -1;
        } else {
            result = PyDict_SetItem(kwdict, key, value);
        }
        Py_DECREF(key);
        Py_DECREF(value);
        if (unlikely(result < 0)) goto bad;
    }
    Py_XDECREF(iter);
    return 0;
bad:
    Py_XDECREF(iter);
    return -1;
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyIntFromDouble */
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value) {
    if (value >= (double)LONG_MIN && value <= (double)LONG_MAX) {
        return PyInt_FromLong((long)value);
    }
    return PyLong_FromDouble(value);
}
#endif

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* None */
static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
    long r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* IsLittleEndian */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
{
  union {
    uint32_t u32;
    uint8_t u8[4];
  } S;
  S.u32 = 0x01020304;
  return S.u8[0] == 4;
}

/* BufferFormatCheck */
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t <= '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1)
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case '?': return "'bool'";
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparseable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue;
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number, ndim;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return NULL;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
    ndim = ctx->head->field->type->ndim;
    while (*ts && *ts != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;
        }
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return NULL;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
            return PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
        if (*ts != ',' && *ts != ')')
            return PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim)
        return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return NULL;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return Py_None;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        return ts;
      case ' ':
      case '\r':
      case '\n':
        ++ts;
        break;
      case '<':
        if (!__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T':
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }
        CYTHON_FALLTHROUGH;
      case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 'p':
        if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
            (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
        CYTHON_FALLTHROUGH;
      case 's':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->enc_count = ctx->new_count;
        ctx->enc_packmode = ctx->new_packmode;
        ctx->enc_type = *ts;
        ctx->is_complex = got_Z;
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}

/* BufferGetAndValidate */
  static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (unlikely(info->buf == NULL)) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}
static void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}
static int __Pyx__GetBufferAndValidate(
        Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
{
  buf->buf = NULL;
  if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
    __Pyx_ZeroBuffer(buf);
    return -1;
  }
  if (unlikely(buf->ndim != nd)) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if (unlikely((size_t)buf->itemsize != dtype->size)) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_SafeReleaseBuffer(buf);
  return -1;
}

/* CIntToDigits */
  static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode */
  static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
#if CYTHON_PEP393_ENABLED
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
#else
    Py_UNICODE *udata;
    uval = PyUnicode_FromUnicode(NULL, ulength);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_AS_UNICODE(uval);
#endif
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp;
                    PyObject *repeat = PyInt_FromSize_t(uoffset - prepend_sign);
                    if (unlikely(!repeat)) goto done_or_error;
                    tmp = PyNumber_Multiply(padding, repeat);
                    Py_DECREF(repeat);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyNumber_Add(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyNumber_Add(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* CIntToPyUnicode */
  #ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned short    uint16_t;
        #else
           typedef unsigned __int16  uint16_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(int)*3+2];
    char *dpos, *end = digits + sizeof(int)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    int remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (int) (remaining / (8*8));
            dpos -= 2;
            *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_8)[digit_pos];
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (int) (remaining / (10*10));
            dpos -= 2;
            *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_10)[digit_pos];
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (int) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    if (last_one_off) {
        assert(*dpos == '0');
        dpos++;
    }
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* SetItemInt */
  static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
#else
    if (is_list || PySequence_Check(o))
#endif
    {
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* BufferFallbackError */
  static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_SetString(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

/* SliceTupleAndList */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
    Py_ssize_t start = *_start, stop = *_stop, length = *_length;
    if (start < 0) {
        start += length;
        if (start < 0)
            start = 0;
    }
    if (stop < 0)
        stop += length;
    else if (stop > length)
        stop = length;
    *_length = stop - start;
    *_start = start;
    *_stop = stop;
}
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyList_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyList_New(0);
    dest = PyList_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyListObject*)src)->ob_item + start,
        ((PyListObject*)dest)->ob_item,
        length);
    return dest;
}
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyTuple_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyTuple_New(0);
    dest = PyTuple_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyTupleObject*)src)->ob_item + start,
        ((PyTupleObject*)dest)->ob_item,
        length);
    return dest;
}
#endif

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
        double b = PyFloat_AS_DOUBLE(op2);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* None */
  static CYTHON_INLINE double __Pyx_mod_double(double a, double b) {
    double r = fmod(a, b);
    r += ((r != 0) & ((r < 0) ^ (b < 0))) * b;
    return r;
}

/* FetchCommonType */
  static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunctionShared */
  #include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    if (unlikely(op == NULL))
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
#if PY_MAJOR_VERSION < 3
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
#endif
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
  static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* None */
  static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t q = a / b;
    Py_ssize_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* decode_c_string */
  static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        size_t slen = strlen(cstring);
        if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
            PyErr_SetString(PyExc_OverflowError,
                            "c-string too long to convert to Python");
            return NULL;
        }
        length = (Py_ssize_t) slen;
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (unlikely(stop <= start))
        return __Pyx_NewRef(__pyx_empty_unicode);
    length = stop - start;
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* GetAttr3 */
  static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* SwapException */
  #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* FastTypeChecks */
  #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* None */
  static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* CallNextTpTraverse */
  static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->tp_traverse(obj, v, a);
    return 0;
}

/* CallNextTpClear */
  static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

/* PyObject_GenericGetAttrNoDict */
  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetVTable */
  static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* PyObjectGetAttrStrNoError */
  static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
}

/* SetupReduce */
  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
            if (likely(reduce_cython)) {
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* TypeImport */
  #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if ((size_t)basicsize < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* CalculateMetaclass */
  static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
  static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* ClassMethod */
  static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    #if PY_MAJOR_VERSION == 2
    static PyTypeObject *methoddescr_type = NULL;
    if (methoddescr_type == NULL) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (!meth) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    #else
    PyTypeObject *methoddescr_type = &PyMethodDescr_Type;
    #endif
    if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
}

/* GetNameInClass */
  static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
    PyObject *result;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result) {
        result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
    }
    return result;
}

/* CLineInTraceback */
  #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
  #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
        if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
        if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
    if ((0)) {}
    view->obj = NULL;
    Py_DECREF(obj);
}
#endif


  /* MemviewSliceIsContig */
  static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
{
    int i, index, step, start;
    Py_ssize_t itemsize = mvs.memview->view.itemsize;
    if (order == 'F') {
        step = 1;
        start = 0;
    } else {
        step = -1;
        start = ndim - 1;
    }
    for (i = 0; i < ndim; i++) {
        index = start + step * i;
        if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
            return 0;
        itemsize *= mvs.shape[index];
    }
    return 1;
}

/* OverlappingSlices */
  static void
__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
                               void **out_start, void **out_end,
                               int ndim, size_t itemsize)
{
    char *start, *end;
    int i;
    start = end = slice->data;
    for (i = 0; i < ndim; i++) {
        Py_ssize_t stride = slice->strides[i];
        Py_ssize_t extent = slice->shape[i];
        if (extent == 0) {
            *out_start = *out_end = start;
            return;
        } else {
            if (stride > 0)
                end += stride * (extent - 1);
            else
                start += stride * (extent - 1);
        }
    }
    *out_start = start;
    *out_end = end + itemsize;
}
static int
__pyx_slices_overlap(__Pyx_memviewslice *slice1,
                     __Pyx_memviewslice *slice2,
                     int ndim, size_t itemsize)
{
    void *start1, *end1, *start2, *end2;
    __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
    __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
    return (start1 < end2) && (start2 < end1);
}

/* Capsule */
  static CYTHON_INLINE PyObject *
__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
{
    PyObject *cobj;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(p, sig, NULL);
#else
    cobj = PyCObject_FromVoidPtr(p, NULL);
#endif
    return cobj;
}

/* CIntFromPyVerify */
  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* TypeInfoCompare */
  static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
    int i;
    if (!a || !b)
        return 0;
    if (a == b)
        return 1;
    if (a->size != b->size || a->typegroup != b->typegroup ||
            a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
        if (a->typegroup == 'H' || b->typegroup == 'H') {
            return a->size == b->size;
        } else {
            return 0;
        }
    }
    if (a->ndim) {
        for (i = 0; i < a->ndim; i++)
            if (a->arraysize[i] != b->arraysize[i])
                return 0;
    }
    if (a->typegroup == 'S') {
        if (a->flags != b->flags)
            return 0;
        if (a->fields || b->fields) {
            if (!(a->fields && b->fields))
                return 0;
            for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
                __Pyx_StructField *field_a = a->fields + i;
                __Pyx_StructField *field_b = b->fields + i;
                if (field_a->offset != field_b->offset ||
                    !__pyx_typeinfo_cmp(field_a->type, field_b->type))
                    return 0;
            }
            return !a->fields[i].type && !b->fields[i].type;
        }
    }
    return 1;
}

/* MemviewSliceValidateAndInit */
  static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
    if (buf->shape[dim] <= 1)
        return 1;
    if (buf->strides) {
        if (spec & __Pyx_MEMVIEW_CONTIG) {
            if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
                if (unlikely(buf->strides[dim] != sizeof(void *))) {
                    PyErr_Format(PyExc_ValueError,
                                 "Buffer is not indirectly contiguous "
                                 "in dimension %d.", dim);
                    goto fail;
                }
            } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
                PyErr_SetString(PyExc_ValueError,
                                "Buffer and memoryview are not contiguous "
                                "in the same dimension.");
                goto fail;
            }
        }
        if (spec & __Pyx_MEMVIEW_FOLLOW) {
            Py_ssize_t stride = buf->strides[dim];
            if (stride < 0)
                stride = -stride;
            if (unlikely(stride < buf->itemsize)) {
                PyErr_SetString(PyExc_ValueError,
                                "Buffer and memoryview are not contiguous "
                                "in the same dimension.");
                goto fail;
            }
        }
    } else {
        if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
            PyErr_Format(PyExc_ValueError,
                         "C-contiguous buffer is not contiguous in "
                         "dimension %d", dim);
            goto fail;
        } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
            PyErr_Format(PyExc_ValueError,
                         "C-contiguous buffer is not indirect in "
                         "dimension %d", dim);
            goto fail;
        } else if (unlikely(buf->suboffsets)) {
            PyErr_SetString(PyExc_ValueError,
                            "Buffer exposes suboffsets but no strides");
            goto fail;
        }
    }
    return 1;
fail:
    return 0;
}
static int
__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
{
    if (spec & __Pyx_MEMVIEW_DIRECT) {
        if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
            PyErr_Format(PyExc_ValueError,
                         "Buffer not compatible with direct access "
                         "in dimension %d.", dim);
            goto fail;
        }
    }
    if (spec & __Pyx_MEMVIEW_PTR) {
        if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
            PyErr_Format(PyExc_ValueError,
                         "Buffer is not indirectly accessible "
                         "in dimension %d.", dim);
            goto fail;
        }
    }
    return 1;
fail:
    return 0;
}
static int
__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
{
    int i;
    if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
        Py_ssize_t stride = 1;
        for (i = 0; i < ndim; i++) {
            if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
                PyErr_SetString(PyExc_ValueError,
                    "Buffer not fortran contiguous.");
                goto fail;
            }
            stride = stride * buf->shape[i];
        }
    } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
        Py_ssize_t stride = 1;
        for (i = ndim - 1; i >- 1; i--) {
            if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
                PyErr_SetString(PyExc_ValueError,
                    "Buffer not C contiguous.");
                goto fail;
            }
            stride = stride * buf->shape[i];
        }
    }
    return 1;
fail:
    return 0;
}
static int __Pyx_ValidateAndInit_memviewslice(
                int *axes_specs,
                int c_or_f_flag,
                int buf_flags,
                int ndim,
                __Pyx_TypeInfo *dtype,
                __Pyx_BufFmt_StackElem stack[],
                __Pyx_memviewslice *memviewslice,
                PyObject *original_obj)
{
    struct __pyx_memoryview_obj *memview, *new_memview;
    __Pyx_RefNannyDeclarations
    Py_buffer *buf;
    int i, spec = 0, retval = -1;
    __Pyx_BufFmt_Context ctx;
    int from_memoryview = __pyx_memoryview_check(original_obj);
    __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
    if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
                                                            original_obj)->typeinfo)) {
        memview = (struct __pyx_memoryview_obj *) original_obj;
        new_memview = NULL;
    } else {
        memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
                                            original_obj, buf_flags, 0, dtype);
        new_memview = memview;
        if (unlikely(!memview))
            goto fail;
    }
    buf = &memview->view;
    if (unlikely(buf->ndim != ndim)) {
        PyErr_Format(PyExc_ValueError,
                "Buffer has wrong number of dimensions (expected %d, got %d)",
                ndim, buf->ndim);
        goto fail;
    }
    if (new_memview) {
        __Pyx_BufFmt_Init(&ctx, stack, dtype);
        if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
    }
    if (unlikely((unsigned) buf->itemsize != dtype->size)) {
        PyErr_Format(PyExc_ValueError,
                     "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
                     "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
                     buf->itemsize,
                     (buf->itemsize > 1) ? "s" : "",
                     dtype->name,
                     dtype->size,
                     (dtype->size > 1) ? "s" : "");
        goto fail;
    }
    if (buf->len > 0) {
        for (i = 0; i < ndim; i++) {
            spec = axes_specs[i];
            if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
                goto fail;
            if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
                goto fail;
        }
        if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
            goto fail;
    }
    if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
                                         new_memview != NULL) == -1)) {
        goto fail;
    }
    retval = 0;
    goto no_fail;
fail:
    Py_XDECREF(new_memview);
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}

/* ObjectToMemviewSlice */
  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS_RO | writable_flag, 1,
                                                 &__Pyx_TypeInfo_double, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

/* ObjectToMemviewSlice */
  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj, int writable_flag) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
                                                 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
                                                 &__Pyx_TypeInfo_double, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

/* MemviewDtypeToObject */
  static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
    return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
}
static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
    double value = __pyx_PyFloat_AsDouble(obj);
    if ((value == (double)-1) && PyErr_Occurred())
        return 0;
    *(double *) itemp = value;
    return 1;
}

/* Declarations */
  #if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
  #if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsf(b.real) >= fabsf(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                float r = b.imag / b.real;
                float s = (float)(1.0) / (b.real + b.imag * r);
                return __pyx_t_float_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            float r = b.real / b.imag;
            float s = (float)(1.0) / (b.imag + b.real * r);
            return __pyx_t_float_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            float denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_float_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_float(a, a);
                    case 3:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, a);
                    case 4:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = powf(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2f(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_float(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

/* Declarations */
  #if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    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 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 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;
    }
#endif

/* Arithmetic */
  #if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__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 CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__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 CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__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;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* MemviewSliceCopyTemplate */
  static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
                                 const char *mode, int ndim,
                                 size_t sizeof_dtype, int contig_flag,
                                 int dtype_is_object)
{
    __Pyx_RefNannyDeclarations
    int i;
    __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
    struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
    Py_buffer *buf = &from_memview->view;
    PyObject *shape_tuple = NULL;
    PyObject *temp_int = NULL;
    struct __pyx_array_obj *array_obj = NULL;
    struct __pyx_memoryview_obj *memview_obj = NULL;
    __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
    for (i = 0; i < ndim; i++) {
        if (unlikely(from_mvs->suboffsets[i] >= 0)) {
            PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
                                           "indirect dimensions (axis %d)", i);
            goto fail;
        }
    }
    shape_tuple = PyTuple_New(ndim);
    if (unlikely(!shape_tuple)) {
        goto fail;
    }
    __Pyx_GOTREF(shape_tuple);
    for(i = 0; i < ndim; i++) {
        temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
        if(unlikely(!temp_int)) {
            goto fail;
        } else {
            PyTuple_SET_ITEM(shape_tuple, i, temp_int);
            temp_int = NULL;
        }
    }
    array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
    if (unlikely(!array_obj)) {
        goto fail;
    }
    __Pyx_GOTREF(array_obj);
    memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
                                    (PyObject *) array_obj, contig_flag,
                                    dtype_is_object,
                                    from_mvs->memview->typeinfo);
    if (unlikely(!memview_obj))
        goto fail;
    if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
        goto fail;
    if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
                                                dtype_is_object) < 0))
        goto fail;
    goto no_fail;
fail:
    __Pyx_XDECREF(new_mvs.memview);
    new_mvs.memview = NULL;
    new_mvs.data = NULL;
no_fail:
    __Pyx_XDECREF(shape_tuple);
    __Pyx_XDECREF(temp_int);
    __Pyx_XDECREF(array_obj);
    __Pyx_RefNannyFinishContext();
    return new_mvs;
}

/* CIntFromPy */
  static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
                case 2:
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
                            return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
                            return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
                            return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (unsigned int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(unsigned int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(unsigned int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            unsigned int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (unsigned int) -1;
        }
    } else {
        unsigned int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned int) -1;
        val = __Pyx_PyInt_As_unsigned_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned int");
    return (unsigned int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned int");
    return (unsigned int) -1;
}

/* CIntFromPy */
  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
  static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Py_intptr_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const char neg_one = (char) -1, const_zero = (char) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(char) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (char) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (char) 0;
                case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
                case 2:
                    if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
                            return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
                            return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
                            return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (char) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(char) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (char) 0;
                case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
                            return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
                            return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
                            return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
                            return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
                            return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
                            return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(char) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            char val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (char) -1;
        }
    } else {
        char val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (char) -1;
        val = __Pyx_PyInt_As_char(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to char");
    return (char) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to char");
    return (char) -1;
}

/* PyObjectCallMethod1 */
  static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* CoroutineBase */
  #include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_type) {
        #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
        #else
        if (exc_state->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *exc_tb = exc_state->exc_traceback;
    if (likely(exc_tb)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
            _PyGen_SetStopIterationValue(result);
        }
        Py_CLEAR(result);
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_frame);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (Py_REFCNT(self) > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    __Pyx_SET_REFCNT(self, 1);
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(Py_REFCNT(self) > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = Py_REFCNT(self);
        _Py_NewReference(self);
        __Pyx_SET_REFCNT(self, refcnt);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(Py_TYPE(self)) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *frame = self->gi_frame;
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            __pyx_d,                 /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        if (unlikely(!frame))
            return NULL;
        self->gi_frame = frame;
    }
    Py_INCREF(frame);
    return frame;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    gen->gi_frame = NULL;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
  static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
  #ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
  static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     (char*) PyDoc_STR("Frame of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
  static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
